bapfalraz commited on
Commit
204e114
·
verified ·
1 Parent(s): 1d421cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
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-pt", torch_dtype=torch.bfloat16)
10
 
11
  txt = st.text_area("Test this")
12
 
13
  if (txt):
14
- st.write(pipe(txt, max_new_tokens=50))
 
 
 
 
 
 
 
 
 
 
 
 
 
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))