Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -23,26 +23,22 @@ def translate_wrapper(text, src, trg, by_sentence=True, preprocess=True, random= | |
| 23 |  | 
| 24 |  | 
| 25 | 
             
            article = """
         | 
| 26 | 
            -
            This is a NLLB-200-600M model fine-tuned for translation between  | 
| 27 | 
            -
            using the data from https://tyvan.ru/.
         | 
| 28 | 
            -
            This model is described in https://cointegrated.medium.com/a37fc706b865.
         | 
| 29 | 
            -
            If you want to host in on your own backend, consider running this dockerized app: https://github.com/slone-nlp/nllb-docker-demo.
         | 
| 30 | 
            -
            """
         | 
| 31 |  | 
| 32 |  | 
| 33 | 
             
            interface = gr.Interface(
         | 
| 34 | 
             
                translate_wrapper,
         | 
| 35 | 
             
                [
         | 
| 36 | 
             
                    gr.Textbox(label="Text", lines=2, placeholder='text to translate '),
         | 
| 37 | 
            -
                    gr.Dropdown(LANGUAGES_LIST, type="value", label='source language', value=LANGUAGES_LIST[ | 
| 38 | 
            -
                    gr.Dropdown(LANGUAGES_LIST, type="value", label='target language', value=LANGUAGES_LIST[ | 
| 39 | 
             
                    gr.Checkbox(label="by sentence", value=True),
         | 
| 40 | 
             
                    gr.Checkbox(label="text preprocesing", value=True),
         | 
| 41 | 
             
                    gr.Checkbox(label="randomize", value=False),
         | 
| 42 | 
             
                    gr.Dropdown([1, 2, 3, 4, 5], label="number of beams", value=4),
         | 
| 43 | 
             
                ],
         | 
| 44 | 
             
                "text",
         | 
| 45 | 
            -
                title=' | 
| 46 | 
             
                article=article,
         | 
| 47 | 
             
            )
         | 
| 48 |  | 
|  | |
| 23 |  | 
| 24 |  | 
| 25 | 
             
            article = """
         | 
| 26 | 
            +
            This is a NLLB-200-600M model fine-tuned for translation between Español and Rapa Nui languages"""
         | 
|  | |
|  | |
|  | |
|  | |
| 27 |  | 
| 28 |  | 
| 29 | 
             
            interface = gr.Interface(
         | 
| 30 | 
             
                translate_wrapper,
         | 
| 31 | 
             
                [
         | 
| 32 | 
             
                    gr.Textbox(label="Text", lines=2, placeholder='text to translate '),
         | 
| 33 | 
            +
                    gr.Dropdown(LANGUAGES_LIST, type="value", label='source language', value=LANGUAGES_LIST[1]),
         | 
| 34 | 
            +
                    gr.Dropdown(LANGUAGES_LIST, type="value", label='target language', value=LANGUAGES_LIST[0]),
         | 
| 35 | 
             
                    gr.Checkbox(label="by sentence", value=True),
         | 
| 36 | 
             
                    gr.Checkbox(label="text preprocesing", value=True),
         | 
| 37 | 
             
                    gr.Checkbox(label="randomize", value=False),
         | 
| 38 | 
             
                    gr.Dropdown([1, 2, 3, 4, 5], label="number of beams", value=4),
         | 
| 39 | 
             
                ],
         | 
| 40 | 
             
                "text",
         | 
| 41 | 
            +
                title='Español-RapaNui translaton',
         | 
| 42 | 
             
                article=article,
         | 
| 43 | 
             
            )
         | 
| 44 |  |