Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,10 +16,10 @@ def init():
|
|
| 16 |
#raise ValueError("HUGGINGFACE_TOKEN environment variable is not set")
|
| 17 |
|
| 18 |
model_id = "google/gemma-2-9b-it"
|
| 19 |
-
model_id = "microsoft/Phi-3-mini-128k-instruct"
|
| 20 |
|
| 21 |
device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 22 |
-
device = "cuda"
|
| 23 |
dtype = torch.bfloat16
|
| 24 |
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained(model_id, token=huggingface_token)
|
|
@@ -38,7 +38,7 @@ def init():
|
|
| 38 |
else:
|
| 39 |
print("The model is on a CPU")
|
| 40 |
|
| 41 |
-
print(f"text_generator.device='{text_generator.device}")
|
| 42 |
if str(text_generator.device).strip() == 'cuda':
|
| 43 |
print("The pipeline is using a GPU")
|
| 44 |
else:
|
|
|
|
| 16 |
#raise ValueError("HUGGINGFACE_TOKEN environment variable is not set")
|
| 17 |
|
| 18 |
model_id = "google/gemma-2-9b-it"
|
| 19 |
+
#model_id = "microsoft/Phi-3-mini-128k-instruct"
|
| 20 |
|
| 21 |
device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 22 |
+
#device = "cuda"
|
| 23 |
dtype = torch.bfloat16
|
| 24 |
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained(model_id, token=huggingface_token)
|
|
|
|
| 38 |
else:
|
| 39 |
print("The model is on a CPU")
|
| 40 |
|
| 41 |
+
#print(f"text_generator.device='{text_generator.device}")
|
| 42 |
if str(text_generator.device).strip() == 'cuda':
|
| 43 |
print("The pipeline is using a GPU")
|
| 44 |
else:
|