Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
#
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
def chatbot_response(message, history):
|
13 |
-
# ุงุณุชุฎุฏุงู
ุงูู
ูุฏูู ูุชูููุฏ ุงูุฑุฏ
|
14 |
-
output = pipe(message, max_new_tokens=150, do_sample=True)[0]['generated_text']
|
15 |
-
history = history + [(message, output)]
|
16 |
-
return history, history
|
17 |
-
|
18 |
-
with gr.Blocks() as demo:
|
19 |
-
chatbot = gr.Chatbot()
|
20 |
-
msg = gr.Textbox(placeholder="ุงูุชุจ ุฑุณุงูุชู ููุง...")
|
21 |
-
state = gr.State([]) # ุญูุธ ุงูู
ุญุงุฏุซุฉ
|
22 |
-
|
23 |
-
msg.submit(chatbot_response, inputs=[msg, state], outputs=[chatbot, state])
|
24 |
-
|
25 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
with gr.Blocks(fill_height=True) as demo:
|
4 |
+
with gr.Sidebar():
|
5 |
+
gr.Markdown("# Inference Provider")
|
6 |
+
gr.Markdown("This Space showcases the deepseek-ai/DeepSeek-V3 model, served by the fireworks-ai API. Sign in with your Hugging Face account to use this API.")
|
7 |
+
button = gr.LoginButton("Sign in")
|
8 |
+
gr.load("models/deepseek-ai/DeepSeek-V3", accept_token=button, provider="fireworks-ai")
|
9 |
+
|
10 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|