Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from gradio import Client # Correct import statement | |
| title = "RoyalGPT 7B Chatbot" | |
| description = """ | |
| This Space demonstrates model [RoyalGPT-7B-chat-hf] by CCL, a Llama 2 model with 7B parameters fine-tuned for Bangla chat instructions. | |
| """ | |
| css = """.toast-wrap { display: none !important } """ | |
| examples=[ | |
| ['Hello there! How are you doing?'], | |
| ['Can you explain to me briefly what is Python programming language?'], | |
| ['Explain the plot of Cinderella in a sentence.'], | |
| ['How many hours does it take a man to eat a Helicopter?'], | |
| ["Write a 100-word article on 'Benefits of Open-Source in AI research'"], | |
| ] | |
| # Stream text | |
| def predict(message, chatbot): | |
| client = Client("https://sha1779-royalgpt.hf.space/") | |
| return client.predict({'prompt': message}) # Adjusted function call | |
| # Gradio Demo | |
| with gr.Interface(predict, title=title, description=description, css=css, examples=examples) as demo: # Corrected gr.Blocks to gr.Interface | |
| gr.ChatInterface(predict) | |
| demo.launch(debug=True) | |