emmabuhot commited on
Commit
4c75d95
·
verified ·
1 Parent(s): c1431c5

Update requirements.txt

Browse files
Files changed (1) hide show
  1. requirements.txt +1 -22
requirements.txt CHANGED
@@ -1,22 +1 @@
1
- import gradio as gr
2
- from transformers import pipeline
3
- #import spaces
4
-
5
- pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM2-135M-Instruct")
6
-
7
- #@spaces.GPU()
8
- def chat_fn(user_message):
9
- messages = [{"role": "user", "content": user_message}]
10
- response = pipe(messages)
11
- return response[0]["generated_text"]
12
-
13
- demo = gr.Interface(
14
- fn=chat_fn,
15
- inputs=gr.Textbox(label="Your message", placeholder="Ask me anything", lines=3),
16
- outputs=gr.Textbox(label="Model response"),
17
- title="💬 SmolLM2 Chat",
18
- description="Chat app powered by SmolLM2-135M-Instruct"
19
- )
20
-
21
- if __name__ == "__main__":
22
- demo.launch()
 
1
+ transformers