Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,14 @@ import random
|
|
| 5 |
client = InferenceClient("google/gemma-3-27b-it")
|
| 6 |
#this is where you change the LLM
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
demo.launch()
|
| 9 |
|
| 10 |
def respond(message,history):
|
|
@@ -31,11 +39,6 @@ def echo(message, history):
|
|
| 31 |
chat_answer = random.choice(choices)
|
| 32 |
return chat_answer
|
| 33 |
|
| 34 |
-
|
| 35 |
-
with gr.Blocks(theme=gr.themes.Base()) as demo:
|
| 36 |
-
gr.Markdown("Hello, world!")
|
| 37 |
-
gr.Button("Click me")
|
| 38 |
-
|
| 39 |
chatbot = gr.ChatInterface(respond, type = "messages")
|
| 40 |
|
| 41 |
chatbot.launch()
|
|
|
|
| 5 |
client = InferenceClient("google/gemma-3-27b-it")
|
| 6 |
#this is where you change the LLM
|
| 7 |
|
| 8 |
+
with gr.Blocks() as demo:
|
| 9 |
+
gr.Markdown("# Simple Q&A Chatbot")
|
| 10 |
+
|
| 11 |
+
question = gr.Textbox(label="Your Question", placeholder="Type your question here...")
|
| 12 |
+
answer = gr.Textbox(label="Chatbot Answer", interactive=False)
|
| 13 |
+
|
| 14 |
+
question.submit(fn=chatbot_response, inputs=question, outputs=answer)
|
| 15 |
+
|
| 16 |
demo.launch()
|
| 17 |
|
| 18 |
def respond(message,history):
|
|
|
|
| 39 |
chat_answer = random.choice(choices)
|
| 40 |
return chat_answer
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
chatbot = gr.ChatInterface(respond, type = "messages")
|
| 43 |
|
| 44 |
chatbot.launch()
|