Kevin Hu
		
	commited on
		
		
					Commit 
							
							·
						
						ef1a16c
	
1
								Parent(s):
							
							dba7799
								
fix batch size error for qianwen embedding (#2431)
Browse files### What problem does this PR solve?
#2402
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
    	
        rag/llm/embedding_model.py
    CHANGED
    
    | @@ -155,6 +155,7 @@ class QWenEmbed(Base): | |
| 155 |  | 
| 156 | 
             
                def encode(self, texts: list, batch_size=10):
         | 
| 157 | 
             
                    import dashscope
         | 
|  | |
| 158 | 
             
                    try:
         | 
| 159 | 
             
                        res = []
         | 
| 160 | 
             
                        token_count = 0
         | 
|  | |
| 155 |  | 
| 156 | 
             
                def encode(self, texts: list, batch_size=10):
         | 
| 157 | 
             
                    import dashscope
         | 
| 158 | 
            +
                    batch_size = min(batch_size, 4)
         | 
| 159 | 
             
                    try:
         | 
| 160 | 
             
                        res = []
         | 
| 161 | 
             
                        token_count = 0
         |