Spaces:
Runtime error
Runtime error
Reposition the variable
Browse files
app.py
CHANGED
@@ -2,8 +2,10 @@ import os
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
-
# initialize the
|
6 |
model_name = 'anugrahap/gpt2-indo-textgen'
|
|
|
|
|
7 |
|
8 |
# define the tokenization method
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name,
|
@@ -122,9 +124,6 @@ examples = [
|
|
122 |
["Pemandangan di pantai kuta Bali sangatlah indah.", 30, 50, 0.5, 40, 0.98, 10, 1.0, True],
|
123 |
["Pemandangan di pantai kuta Bali sangatlah indah.", 10, 30, 1.5, 30, 0.93, 5, 2.0, True]]
|
124 |
|
125 |
-
HF_TOKEN = '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'
|
126 |
-
callback = gr.HuggingFaceDatasetSaver(HF_TOKEN, "output-gpt2-indo-textgen")
|
127 |
-
|
128 |
# using gradio block to create the interface
|
129 |
with gr.Blocks(title="GPT-2 Indonesian Text Generation Playground", theme='Default') as app:
|
130 |
gr.Markdown("""
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
+
# initialize the environment
|
6 |
model_name = 'anugrahap/gpt2-indo-textgen'
|
7 |
+
HF_TOKEN = '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'
|
8 |
+
callback = gr.HuggingFaceDatasetSaver(HF_TOKEN, "output-gpt2-indo-textgen")
|
9 |
|
10 |
# define the tokenization method
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_name,
|
|
|
124 |
["Pemandangan di pantai kuta Bali sangatlah indah.", 30, 50, 0.5, 40, 0.98, 10, 1.0, True],
|
125 |
["Pemandangan di pantai kuta Bali sangatlah indah.", 10, 30, 1.5, 30, 0.93, 5, 2.0, True]]
|
126 |
|
|
|
|
|
|
|
127 |
# using gradio block to create the interface
|
128 |
with gr.Blocks(title="GPT-2 Indonesian Text Generation Playground", theme='Default') as app:
|
129 |
gr.Markdown("""
|