Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import requests | |
| import json | |
| from gradio_client import Client | |
| import os | |
| token = os.getenv('hf_token') | |
| client = Client("pramodreddy/smt_chatbot_pr",hf_token=token) | |
| def predict(input_text,history): | |
| m = client.predict(input_text) | |
| #l= jsonify({'answer':m}) | |
| return str(m) | |
| interface= gr.ChatInterface( | |
| predict, | |
| chatbot= gr.Chatbot(height=300), | |
| textbox= gr.Textbox(placeholder = "please enter your question here",container=False,scale=7), | |
| title = "GenAI surya Geography Chatbot", | |
| description= "ask me anything about geography", | |
| theme="soft", | |
| #examples=["give me details about transformer","how to contact"] | |
| #cache_examples = True, | |
| retry_btn=None, | |
| undo_btn="delete Previous", | |
| clear_btn= "clear", | |
| ) | |
| if __name__=="__main__": | |
| interface.launch(debug=True) |