Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Tobias Geisler
commited on
Commit
·
fd868fe
1
Parent(s):
9e991a9
show example chatbot ids
Browse files- app.py +6 -0
- tabs/chat.py +3 -3
app.py
CHANGED
@@ -23,6 +23,12 @@ def create_app():
|
|
23 |
chatbot_id_input = gr.Textbox(label="Chatbot-ID eingeben")
|
24 |
load_button = gr.Button("Chatbot laden")
|
25 |
load_message = gr.Textbox(label="Lademeldung", interactive=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
with gr.Tabs():
|
28 |
with gr.Tab("Chat"):
|
|
|
23 |
chatbot_id_input = gr.Textbox(label="Chatbot-ID eingeben")
|
24 |
load_button = gr.Button("Chatbot laden")
|
25 |
load_message = gr.Textbox(label="Lademeldung", interactive=False)
|
26 |
+
|
27 |
+
gr.Examples(
|
28 |
+
examples=["shiny-platypus-699", "delightful-red-panda-273", "glowing-toucan-982", "mellow-toucan-512", "upbeat-elephant-433"],
|
29 |
+
inputs=chatbot_id_input,
|
30 |
+
label="Beispiel-Chatbots"
|
31 |
+
)
|
32 |
|
33 |
with gr.Tabs():
|
34 |
with gr.Tab("Chat"):
|
tabs/chat.py
CHANGED
@@ -5,20 +5,20 @@ def load_chatbot(chatbot_id):
|
|
5 |
chatbot = get_chatbot(chatbot_id)
|
6 |
if chatbot:
|
7 |
return (
|
8 |
-
gr.update(value=f"
|
9 |
gr.update(value=chatbot_id, visible=True),
|
10 |
gr.update(value=f"https://huggingface.co/spaces/codora/ai-app-creator?chatbot_id={chatbot_id}"),
|
11 |
gr.update(value="Chatbot erfolgreich geladen.")
|
12 |
)
|
13 |
return (
|
14 |
-
gr.update(value="
|
15 |
gr.update(value="", visible=True),
|
16 |
gr.update(value=""),
|
17 |
gr.update(value="Ungültige Chatbot-ID oder Chatbot nicht aktiv.")
|
18 |
)
|
19 |
|
20 |
def create_chat_tab(chatbot_id_input, load_button, load_message):
|
21 |
-
chatbot_title = gr.Markdown("
|
22 |
chat_interface = gr.ChatInterface(
|
23 |
chat_with_bot,
|
24 |
additional_inputs=[chatbot_id_input],
|
|
|
5 |
chatbot = get_chatbot(chatbot_id)
|
6 |
if chatbot:
|
7 |
return (
|
8 |
+
gr.update(value=f"# {chatbot.name}\n\nWillkommen bei {chatbot.name}"),
|
9 |
gr.update(value=chatbot_id, visible=True),
|
10 |
gr.update(value=f"https://huggingface.co/spaces/codora/ai-app-creator?chatbot_id={chatbot_id}"),
|
11 |
gr.update(value="Chatbot erfolgreich geladen.")
|
12 |
)
|
13 |
return (
|
14 |
+
gr.update(value="# Chatbot\n\nWillkommen beim Chatbot"),
|
15 |
gr.update(value="", visible=True),
|
16 |
gr.update(value=""),
|
17 |
gr.update(value="Ungültige Chatbot-ID oder Chatbot nicht aktiv.")
|
18 |
)
|
19 |
|
20 |
def create_chat_tab(chatbot_id_input, load_button, load_message):
|
21 |
+
chatbot_title = gr.Markdown("# Chatbot\n\nWillkommen beim Chatbot")
|
22 |
chat_interface = gr.ChatInterface(
|
23 |
chat_with_bot,
|
24 |
additional_inputs=[chatbot_id_input],
|