Update requirements.txt
Browse files- requirements.txt +1 -22
requirements.txt
CHANGED
|
@@ -1,22 +1 @@
|
|
| 1 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|