Update app.py
Browse files
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 |
|