Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	changed hullicination integration method
Browse files
    	
        app.py
    CHANGED
    
    | @@ -279,9 +279,12 @@ def process_and_query(input_language=None,audio_input=None,image_input=None,text | |
| 279 |  | 
| 280 | 
             
                    # Process the summary with OpenAI
         | 
| 281 | 
             
                    final_response = process_summary_with_openai(markdown_output)
         | 
|  | |
|  | |
|  | |
| 282 |  | 
| 283 | 
             
                    # Return the processed summary along with the full output
         | 
| 284 | 
            -
                    return f"**Summary**: {final_response}\n\n**Full output**:\n{markdown_output}"
         | 
| 285 | 
             
                except Exception as e:
         | 
| 286 | 
             
                    return str(e)
         | 
| 287 |  | 
| @@ -432,13 +435,13 @@ with gr.Blocks(theme='ParityError/Anime') as iface : | |
| 432 | 
             
                        ["구강 헤르페스의 적절한 치료법은 무엇입니까?"],
         | 
| 433 | 
             
                        ["Je, ni matibabu gani sahihi kwa herpes ya buccal?"],
         | 
| 434 | 
             
                    ],inputs=[text_input])
         | 
| 435 | 
            -
                with gr.Accordion("hallucination check",open=True):
         | 
| 436 | 
            -
             | 
| 437 | 
            -
             | 
| 438 | 
            -
             | 
| 439 | 
            -
             | 
| 440 | 
            -
             | 
| 441 | 
            -
             | 
| 442 |  | 
| 443 |  | 
| 444 |  | 
|  | |
| 279 |  | 
| 280 | 
             
                    # Process the summary with OpenAI
         | 
| 281 | 
             
                    final_response = process_summary_with_openai(markdown_output)
         | 
| 282 | 
            +
             | 
| 283 | 
            +
                    # check hullucination
         | 
| 284 | 
            +
                    hullucination_score = check_hallucination(text_input,final_response)
         | 
| 285 |  | 
| 286 | 
             
                    # Return the processed summary along with the full output
         | 
| 287 | 
            +
                    return f"**Summary**: {final_response}\n\n**Full output**:\n{markdown_output}\n\n**Hullucination Score**:\n{hullucination_score}"
         | 
| 288 | 
             
                except Exception as e:
         | 
| 289 | 
             
                    return str(e)
         | 
| 290 |  | 
|  | |
| 435 | 
             
                        ["구강 헤르페스의 적절한 치료법은 무엇입니까?"],
         | 
| 436 | 
             
                        ["Je, ni matibabu gani sahihi kwa herpes ya buccal?"],
         | 
| 437 | 
             
                    ],inputs=[text_input])
         | 
| 438 | 
            +
                # with gr.Accordion("hallucination check",open=True):
         | 
| 439 | 
            +
                #     assertion = gr.Textbox(label="assertion")
         | 
| 440 | 
            +
                #     citation =  gr.Textbox(label="citation text")
         | 
| 441 | 
            +
                #     hullucination_output = gr.Markdown(label="output text")
         | 
| 442 | 
            +
                #     hallucination_button = gr.Button("check hallucination")
         | 
| 443 | 
            +
                #     gr.Examples([["i am drunk","sarah is pregnant"]],inputs=[assertion,citation])
         | 
| 444 | 
            +
                #     hallucination_button.click(check_hallucination,inputs=[assertion,citation],outputs=hullucination_output)
         | 
| 445 |  | 
| 446 |  | 
| 447 |  | 
 
			

