myyim commited on
Commit
77071c1
Β·
verified Β·
1 Parent(s): c497a6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,9 +1,9 @@
1
- import os
2
- os.system('pip install torch')
3
-
4
  import torch
5
  from transformers import pipeline
6
  import streamlit as st
 
 
 
7
 
8
  model_id = "google/gemma-2-2b-it"
9
  welcome_message = f"Hello there πŸ‘‹! Is there anything I can help you with?"
@@ -15,6 +15,7 @@ def model_setup(model_id):
15
  model=model_id,
16
  torch_dtype=torch.bfloat16,
17
  device_map="auto",
 
18
  )
19
  return pipe
20
 
 
 
 
 
1
  import torch
2
  from transformers import pipeline
3
  import streamlit as st
4
+ import os
5
+
6
+ token = os.environ.get('HF_TOKEN')
7
 
8
  model_id = "google/gemma-2-2b-it"
9
  welcome_message = f"Hello there πŸ‘‹! Is there anything I can help you with?"
 
15
  model=model_id,
16
  torch_dtype=torch.bfloat16,
17
  device_map="auto",
18
+ token=token,
19
  )
20
  return pipe
21