Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import torch
|
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
4 |
import spaces
|
5 |
-
from transformers import LlamaForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
6 |
import os
|
7 |
from threading import Thread
|
8 |
from polyglot.detect import Detector
|
@@ -145,7 +145,8 @@ with gr.Blocks(theme="soft", css=CSS) as demo:
|
|
145 |
with gr.Row():
|
146 |
submit = gr.Button(value="Submit")
|
147 |
clear = gr.ClearButton([source_text, output_text])
|
148 |
-
|
|
|
149 |
submit.click(fn=huanik, inputs=[source_lang, target_lang, source_text, max_chunk, max_length, temperature], outputs=[output_text])
|
150 |
|
151 |
|
|
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
4 |
import spaces
|
5 |
+
from transformers import LlamaForCausalLM, AutoTokenizer, BitsAndBytesConfig, TextIteratorStreamer
|
6 |
import os
|
7 |
from threading import Thread
|
8 |
from polyglot.detect import Detector
|
|
|
145 |
with gr.Row():
|
146 |
submit = gr.Button(value="Submit")
|
147 |
clear = gr.ClearButton([source_text, output_text])
|
148 |
+
|
149 |
+
source_text.change(lang_detector, source_text, source_lang)
|
150 |
submit.click(fn=huanik, inputs=[source_lang, target_lang, source_text, max_chunk, max_length, temperature], outputs=[output_text])
|
151 |
|
152 |
|