Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -68,5 +68,5 @@ def gradio_chat(query,model_label):
|
|
68 |
except Exception as B:print(f"Error loading image {A}: {B}")
|
69 |
Y={'model':V,'messages':F};I=requests.post(url='https://openrouter.ai/api/v1/chat/completions',headers=U,data=json.dumps(Y));I.raise_for_status();Z=I.json()['choices'][0]['message'][C];return Z,G
|
70 |
except Exception as B:return f"Error: {str(B)}",[]
|
71 |
-
gradio_ui=gr.Interface(fn=gradio_chat,inputs=[gr.Textbox(label='Try: Best island in Maldives'),gr.Dropdown(choices=[A[_B]for A in available_models],value=available_models[0][_B],label='Select Model')],outputs=[gr.Textbox(label='Vega Response'),gr.Gallery(label='Relevant Images',allow_preview=_A)],title='',description='',theme=gr.themes.Default(primary_hue='
|
72 |
if __name__=='__main__':gradio_ui.launch(share=_A)
|
|
|
68 |
except Exception as B:print(f"Error loading image {A}: {B}")
|
69 |
Y={'model':V,'messages':F};I=requests.post(url='https://openrouter.ai/api/v1/chat/completions',headers=U,data=json.dumps(Y));I.raise_for_status();Z=I.json()['choices'][0]['message'][C];return Z,G
|
70 |
except Exception as B:return f"Error: {str(B)}",[]
|
71 |
+
gradio_ui=gr.Interface(fn=gradio_chat,inputs=[gr.Textbox(label='Try: Best island in Maldives'),gr.Dropdown(choices=[A[_B]for A in available_models],value=available_models[0][_B],label='Select Model')],outputs=[gr.Textbox(label='Vega Response'),gr.Gallery(label='Relevant Images',allow_preview=_A)],title='',description='',theme=gr.themes.Default(primary_hue='sky'))
|
72 |
if __name__=='__main__':gradio_ui.launch(share=_A)
|