Spaces:
Build error
Build error
Commit
·
637a8ee
1
Parent(s):
b112983
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ print(device)
|
|
10 |
|
11 |
model_name = "bigscience/bloom-1b"
|
12 |
|
13 |
-
model = BloomForCausalLM.from_pretrained(model_name
|
14 |
tokenizer = BloomTokenizerFast.from_pretrained(model_name)
|
15 |
|
16 |
# Define the pipeline for Gradio purpose
|
@@ -19,7 +19,7 @@ def beam_gradio_pipeline(prompt,length=500):
|
|
19 |
|
20 |
result_length = length
|
21 |
|
22 |
-
inputs = tokenizer(prompt, return_tensors="pt").to(
|
23 |
|
24 |
return tokenizer.decode(model.generate(inputs["input_ids"],
|
25 |
max_length=result_length,
|
|
|
10 |
|
11 |
model_name = "bigscience/bloom-1b"
|
12 |
|
13 |
+
model = BloomForCausalLM.from_pretrained(model_name).to(device)
|
14 |
tokenizer = BloomTokenizerFast.from_pretrained(model_name)
|
15 |
|
16 |
# Define the pipeline for Gradio purpose
|
|
|
19 |
|
20 |
result_length = length
|
21 |
|
22 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
23 |
|
24 |
return tokenizer.decode(model.generate(inputs["input_ids"],
|
25 |
max_length=result_length,
|