Spaces:
Sleeping
Sleeping
Louise here
#2
by
louisepxllock
- opened
README.md
CHANGED
|
@@ -4,10 +4,9 @@ emoji: ⚡
|
|
| 4 |
colorFrom: green
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 5.
|
| 8 |
-
python_version: 3.12.0
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
| 12 |
|
| 13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 4 |
colorFrom: green
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.41.1
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
# import random
|
| 4 |
from huggingface_hub import InferenceClient
|
| 5 |
|
| 6 |
-
|
| 7 |
client = InferenceClient("microsoft/phi-4")
|
| 8 |
|
| 9 |
def respond(message, history):
|
| 10 |
-
messages = [{"role": "system", "content": "you are a
|
| 11 |
|
| 12 |
if history:
|
| 13 |
messages.extend(history)
|
|
@@ -21,13 +19,9 @@ def respond(message, history):
|
|
| 21 |
)
|
| 22 |
return response['choices'][0]['message']['content'].strip()
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
chatbot = gr.ChatInterface(respond, type = "messages",)
|
| 28 |
|
| 29 |
-
|
| 30 |
chatbot.launch()
|
| 31 |
|
| 32 |
|
| 33 |
-
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
# import random
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
|
|
|
| 5 |
client = InferenceClient("microsoft/phi-4")
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
+
messages = [{"role": "system", "content": "you are a friendly chatbot to help pick options for university subjects"}]
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
|
|
|
| 19 |
)
|
| 20 |
return response['choices'][0]['message']['content'].strip()
|
| 21 |
|
| 22 |
+
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
chatbot = gr.ChatInterface(respond, type = "messages", title = "Friendly chatbot") #chatbot ui - conversation history and user input
|
| 25 |
chatbot.launch()
|
| 26 |
|
| 27 |
|
|
|