Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,10 @@ import gradio as gr
|
|
2 |
import transformers
|
3 |
import torch
|
4 |
|
|
|
|
|
|
|
|
|
5 |
# Initialize the model
|
6 |
model_id = "bmi-labmedinfo/Igea-350M-v0.0.1"
|
7 |
pipeline = transformers.pipeline(
|
@@ -9,6 +13,7 @@ pipeline = transformers.pipeline(
|
|
9 |
model=model_id,
|
10 |
model_kwargs={"torch_dtype": torch.bfloat16},
|
11 |
device_map="auto",
|
|
|
12 |
)
|
13 |
|
14 |
# Define the function to generate text
|
|
|
2 |
import transformers
|
3 |
import torch
|
4 |
|
5 |
+
import os
|
6 |
+
|
7 |
+
hf_key = os.getenv("HF_TOKEN")
|
8 |
+
|
9 |
# Initialize the model
|
10 |
model_id = "bmi-labmedinfo/Igea-350M-v0.0.1"
|
11 |
pipeline = transformers.pipeline(
|
|
|
13 |
model=model_id,
|
14 |
model_kwargs={"torch_dtype": torch.bfloat16},
|
15 |
device_map="auto",
|
16 |
+
token=hf_key
|
17 |
)
|
18 |
|
19 |
# Define the function to generate text
|