Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,21 @@ from huggingface_hub import login
|
|
6 |
|
7 |
|
8 |
login(token = os.getenv('HF_TOKEN'))
|
9 |
-
pipe = pipeline("text-generation", model="google/gemma-3-1b-
|
10 |
|
11 |
txt = st.text_area("Test this")
|
12 |
|
13 |
if (txt):
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
|
8 |
login(token = os.getenv('HF_TOKEN'))
|
9 |
+
pipe = pipeline("text-generation", model="google/gemma-3-1b-it", torch_dtype=torch.bfloat16)
|
10 |
|
11 |
txt = st.text_area("Test this")
|
12 |
|
13 |
if (txt):
|
14 |
+
messages = [
|
15 |
+
[
|
16 |
+
{
|
17 |
+
"role": "system",
|
18 |
+
"content": [{"type": "text", "text": "You are a helpful assistant."},]
|
19 |
+
},
|
20 |
+
{
|
21 |
+
"role": "user",
|
22 |
+
"content": [{"type": "text", "text": "Write a poem on Hugging Face, the company"},]
|
23 |
+
},
|
24 |
+
],
|
25 |
+
]
|
26 |
+
st.write(pipe(messages, max_new_tokens=50))
|