CreitinGameplays
commited on
Commit
•
4d43c78
1
Parent(s):
fab30bb
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
12 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
13 |
model.to(device)
|
14 |
|
15 |
-
|
16 |
def generate_text(user_prompt):
|
17 |
"""Generates text using the BLOOM model from Hugging Face Transformers and removes the user prompt."""
|
18 |
# Construct the full prompt with system introduction, user prompt, and assistant role
|
|
|
12 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
13 |
model.to(device)
|
14 |
|
15 |
+
@spaces.GPU(duration=70)
|
16 |
def generate_text(user_prompt):
|
17 |
"""Generates text using the BLOOM model from Hugging Face Transformers and removes the user prompt."""
|
18 |
# Construct the full prompt with system introduction, user prompt, and assistant role
|