Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,13 @@ def categorize(input):
|
|
95 |
|
96 |
return ttc(input)[0]["generated_text"]
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
with gr.Blocks(theme="abidlabs/Lime") as demo:
|
99 |
gr.Markdown("# TURNA 🐦")
|
100 |
gr.Markdown(DESCRIPTION)
|
@@ -112,6 +119,19 @@ with gr.Blocks(theme="abidlabs/Lime") as demo:
|
|
112 |
sentiment_submit.click(sentiment_analysis, inputs=[sentiment_input, sentiment_choice], outputs=sentiment_output)
|
113 |
sentiment_examples = gr.Examples(examples = sentiment_example, inputs = [sentiment_input, sentiment_choice], outputs=sentiment_output, fn=sentiment_analysis)
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
with gr.Tab("Text Categorization"):
|
116 |
gr.Markdown("TURNA fine-tuned on text categorization. Enter text to categorize text or try the example.")
|
117 |
with gr.Column():
|
|
|
95 |
|
96 |
return ttc(input)[0]["generated_text"]
|
97 |
|
98 |
+
@spaces.GPU
|
99 |
+
def turna(input):
|
100 |
+
turna = pipeline(model="boun-tabi-LMG/TURNA", device=0)
|
101 |
+
|
102 |
+
return turna(input)[0]["generated_text"]
|
103 |
+
|
104 |
+
|
105 |
with gr.Blocks(theme="abidlabs/Lime") as demo:
|
106 |
gr.Markdown("# TURNA 🐦")
|
107 |
gr.Markdown(DESCRIPTION)
|
|
|
119 |
sentiment_submit.click(sentiment_analysis, inputs=[sentiment_input, sentiment_choice], outputs=sentiment_output)
|
120 |
sentiment_examples = gr.Examples(examples = sentiment_example, inputs = [sentiment_input, sentiment_choice], outputs=sentiment_output, fn=sentiment_analysis)
|
121 |
|
122 |
+
with gr.Tab("TURNA 🐦"):
|
123 |
+
gr.Markdown("Pre-trained TURNA. Enter text to start generating.")
|
124 |
+
with gr.Column():
|
125 |
+
with gr.Row():
|
126 |
+
with gr.Column():
|
127 |
+
text_gen_input = gr.Textbox(label="Text Generation Input")
|
128 |
+
|
129 |
+
text_gen_submit = gr.Button()
|
130 |
+
text_gen_output = gr.Textbox(label="Text Generation Output")
|
131 |
+
text_gen_submit.click(turna, inputs=[text_gen_input], outputs=text_gen_output)
|
132 |
+
text_gen_example = "Bir varmış, bir yokmuş, evvel zaman içinde, kalbur saman içinde, uzak diyarların birinde bir turna"
|
133 |
+
text_gen_examples = gr.Examples(examples = text_gen_example, inputs = [text_gen_input], outputs=text_gen_output, fn=turna)
|
134 |
+
|
135 |
with gr.Tab("Text Categorization"):
|
136 |
gr.Markdown("TURNA fine-tuned on text categorization. Enter text to categorize text or try the example.")
|
137 |
with gr.Column():
|