Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -126,9 +126,7 @@ def upload_file(file, model_name, split_strategy, overlap_size,chunk_size,  max_ | |
| 126 | 
             
                except ValueError:
         | 
| 127 | 
             
                    return {"error": "Chunk size and overlap size must be valid integers."}
         | 
| 128 |  | 
| 129 | 
            -
             | 
| 130 | 
            -
                print('ov size: '+overlap_size)
         | 
| 131 | 
            -
                
         | 
| 132 | 
             
                # Handle file upload using Gradio file object
         | 
| 133 | 
             
                file_path = file.name  # Get the file path from Gradio file object
         | 
| 134 |  | 
| @@ -137,7 +135,7 @@ def upload_file(file, model_name, split_strategy, overlap_size,chunk_size,  max_ | |
| 137 | 
             
                shutil.copyfile(file_path, destination_path)  # Use shutil to copy the file
         | 
| 138 |  | 
| 139 | 
             
                # Process files and get embeddings
         | 
| 140 | 
            -
                embeddings, chunks = process_files(model_name, split_strategy,  | 
| 141 |  | 
| 142 | 
             
                # Perform search
         | 
| 143 | 
             
                results = search_embeddings(query, model_name, top_k)
         | 
|  | |
| 126 | 
             
                except ValueError:
         | 
| 127 | 
             
                    return {"error": "Chunk size and overlap size must be valid integers."}
         | 
| 128 |  | 
| 129 | 
            +
                  
         | 
|  | |
|  | |
| 130 | 
             
                # Handle file upload using Gradio file object
         | 
| 131 | 
             
                file_path = file.name  # Get the file path from Gradio file object
         | 
| 132 |  | 
|  | |
| 135 | 
             
                shutil.copyfile(file_path, destination_path)  # Use shutil to copy the file
         | 
| 136 |  | 
| 137 | 
             
                # Process files and get embeddings
         | 
| 138 | 
            +
                embeddings, chunks = process_files(model_name, split_strategy, chunk_size, overlap_size, max_tokens)
         | 
| 139 |  | 
| 140 | 
             
                # Perform search
         | 
| 141 | 
             
                results = search_embeddings(query, model_name, top_k)
         |