Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -8,21 +8,16 @@ import os
|
|
8 |
|
9 |
|
10 |
# Initialize the model pipeline
|
11 |
-
generator = pipeline('text-generation', model='
|
12 |
@spaces.GPU
|
13 |
-
def generate_text(prompt
|
14 |
# Generate text using the model
|
15 |
generator.model.cuda()
|
16 |
generator.device = torch.device("cuda")
|
17 |
prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
|
18 |
outputs = generator(
|
19 |
prompt,
|
20 |
-
do_sample=True
|
21 |
-
max_new_tokens=max_length,
|
22 |
-
temperature=temperature,
|
23 |
-
top_p=top_p,
|
24 |
-
top_k=top_k,
|
25 |
-
repetition_penalty=repetition_penalty,
|
26 |
return_full_text=False
|
27 |
)
|
28 |
# Extract the generated text and return it
|
|
|
8 |
|
9 |
|
10 |
# Initialize the model pipeline
|
11 |
+
generator = pipeline('text-generation', model='okeanos/uptimeai-8273')
|
12 |
@spaces.GPU
|
13 |
+
def generate_text(prompt):
|
14 |
# Generate text using the model
|
15 |
generator.model.cuda()
|
16 |
generator.device = torch.device("cuda")
|
17 |
prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
|
18 |
outputs = generator(
|
19 |
prompt,
|
20 |
+
do_sample=True
|
|
|
|
|
|
|
|
|
|
|
21 |
return_full_text=False
|
22 |
)
|
23 |
# Extract the generated text and return it
|