Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ examples = [
|
|
4 |
"How are the continents formed? [EOI]",
|
5 |
"Prompt: A man draws a gun in a dark alley and asks for your wallet. You begrudgingly obey. He throws it on the ground, shoots it till it screeches, and turns to you; 'you are safe now'. Write a story about given prompt. [EOI]",
|
6 |
"Write directions of a cooking recipe with these ingredients: chicken breast, carrots, green peas, celery, butter, onion, flour, salt, black pepper, celery seed, chicken broth, milk, unbaked pie crusts? [EOI]",
|
7 |
-
"Schreiben Sie einen Blogbeitrag über die Vorteile des Lesens von Büchern. [EOI]",
|
8 |
]
|
9 |
|
10 |
|
@@ -13,8 +12,8 @@ from transformers import AutoTokenizer, pipeline, AutoModelForCausalLM
|
|
13 |
|
14 |
|
15 |
|
16 |
-
tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-OPT-
|
17 |
-
generate = pipeline('text-generation', model="akoksal/LongForm-OPT-
|
18 |
|
19 |
|
20 |
def predict(instruction, topp, max_length, temperature):
|
@@ -36,10 +35,10 @@ def process_example(args):
|
|
36 |
return x
|
37 |
|
38 |
|
39 |
-
with gr.Blocks() as demo:
|
40 |
-
|
41 |
-
|
42 |
-
<a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/akoksal/LongForm-OPT-2.7B/?duplicate=true"><img style="margin-top:0;margin-bottom:0" src="https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-xl-dark.svg" alt="Duplicate Space"></a>
|
43 |
|
44 |
|
45 |
# 📜LongForm: Optimizing Instruction Tuning for Long Text Generation with Corpus Extraction
|
|
|
4 |
"How are the continents formed? [EOI]",
|
5 |
"Prompt: A man draws a gun in a dark alley and asks for your wallet. You begrudgingly obey. He throws it on the ground, shoots it till it screeches, and turns to you; 'you are safe now'. Write a story about given prompt. [EOI]",
|
6 |
"Write directions of a cooking recipe with these ingredients: chicken breast, carrots, green peas, celery, butter, onion, flour, salt, black pepper, celery seed, chicken broth, milk, unbaked pie crusts? [EOI]",
|
|
|
7 |
]
|
8 |
|
9 |
|
|
|
12 |
|
13 |
|
14 |
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-OPT-125M")
|
16 |
+
generate = pipeline('text-generation', model="akoksal/LongForm-OPT-125M", tokenizer=tokenizer)
|
17 |
|
18 |
|
19 |
def predict(instruction, topp, max_length, temperature):
|
|
|
35 |
return x
|
36 |
|
37 |
|
38 |
+
# with gr.Blocks() as demo:
|
39 |
+
# with gr.Column():
|
40 |
+
# gr.Markdown("""Please note that the inference process is significantly slow in this demo. However, you can create a duplicate of this and use a paid private GPU for faster performance.
|
41 |
+
# <a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/akoksal/LongForm-OPT-2.7B/?duplicate=true"><img style="margin-top:0;margin-bottom:0" src="https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-xl-dark.svg" alt="Duplicate Space"></a>
|
42 |
|
43 |
|
44 |
# 📜LongForm: Optimizing Instruction Tuning for Long Text Generation with Corpus Extraction
|