Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -50,15 +50,13 @@ def search_embeddings(query_text, output_option): | |
| 50 | 
             
                    return md
         | 
| 51 | 
             
                elif output_option == "RAG-friendly":
         | 
| 52 | 
             
                    hit_texts = [hit["text"] for hit in hits]
         | 
| 53 | 
            -
                     | 
| 54 | 
            -
                    md = f'Here are some relevant docs regarding to the user query "{query_text}":\n\n' + hit_text_str
         | 
| 55 | 
            -
                    return md
         | 
| 56 |  | 
| 57 |  | 
| 58 | 
             
            demo = gr.Interface(
         | 
| 59 | 
             
                fn=search_embeddings,
         | 
| 60 | 
             
                inputs=[gr.Textbox(label="enter your query", placeholder="Type Markdown here...", lines=10), gr.Radio(label="Select an output option", choices=output_options, value="RAG-friendly")],
         | 
| 61 | 
            -
                outputs=gr. | 
| 62 | 
             
                title="HF Docs Emebddings Explorer",
         | 
| 63 | 
             
                allow_flagging="never"
         | 
| 64 | 
             
            )
         | 
|  | |
| 50 | 
             
                    return md
         | 
| 51 | 
             
                elif output_option == "RAG-friendly":
         | 
| 52 | 
             
                    hit_texts = [hit["text"] for hit in hits]
         | 
| 53 | 
            +
                    return hit_texts
         | 
|  | |
|  | |
| 54 |  | 
| 55 |  | 
| 56 | 
             
            demo = gr.Interface(
         | 
| 57 | 
             
                fn=search_embeddings,
         | 
| 58 | 
             
                inputs=[gr.Textbox(label="enter your query", placeholder="Type Markdown here...", lines=10), gr.Radio(label="Select an output option", choices=output_options, value="RAG-friendly")],
         | 
| 59 | 
            +
                outputs=gr.Textbox(placeholder="Results will appear here...", label="Search Results"),
         | 
| 60 | 
             
                title="HF Docs Emebddings Explorer",
         | 
| 61 | 
             
                allow_flagging="never"
         | 
| 62 | 
             
            )
         | 

