Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -18,13 +18,14 @@ def load_models(): 
     | 
|
| 18 | 
         
             
                # original_model = T5ForConditionalGeneration.from_pretrained(original_model_name).to(device)
         
     | 
| 19 | 
         | 
| 20 | 
         
             
                # 加载微调模型
         
     | 
| 21 | 
         
            -
                finetuned_model_path = "utrobinmv/t5_translate_en_ru_zh_small_1024"
         
     | 
| 22 | 
         
            -
                finetuned_tokenizer = T5Tokenizer.from_pretrained(finetuned_model_path)
         
     | 
| 23 | 
         
            -
                finetuned_model = T5ForConditionalGeneration.from_pretrained(finetuned_model_path).to(device)
         
     | 
| 24 | 
         
            -
             
     | 
| 25 | 
         
            -
                # finetuned_model_path = r"C:\Users\gdnjr5233_YOLO\Desktop\ВКР_2025\finetuned_model_v2\best_model"
         
     | 
| 26 | 
         
             
                # finetuned_tokenizer = T5Tokenizer.from_pretrained(finetuned_model_path)
         
     | 
| 27 | 
         
             
                # finetuned_model = T5ForConditionalGeneration.from_pretrained(finetuned_model_path).to(device)
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 28 | 
         | 
| 29 | 
         
             
                # 加载困惑度模型
         
     | 
| 30 | 
         
             
                perplexity_model = GPT2LMHeadModel.from_pretrained("gpt2").to(device)
         
     | 
| 
         | 
|
| 18 | 
         
             
                # original_model = T5ForConditionalGeneration.from_pretrained(original_model_name).to(device)
         
     | 
| 19 | 
         | 
| 20 | 
         
             
                # 加载微调模型
         
     | 
| 21 | 
         
            +
                # finetuned_model_path = "utrobinmv/t5_translate_en_ru_zh_small_1024"
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 22 | 
         
             
                # finetuned_tokenizer = T5Tokenizer.from_pretrained(finetuned_model_path)
         
     | 
| 23 | 
         
             
                # finetuned_model = T5ForConditionalGeneration.from_pretrained(finetuned_model_path).to(device)
         
     | 
| 24 | 
         
            +
             
     | 
| 25 | 
         
            +
                # finetuned_model_path = r"C:\Users\gdnjr5233_YOLO\Desktop\ВКР_2025\finetuned_model_v2\best_model"
         
     | 
| 26 | 
         
            +
                finetuned_model_path = "finetuned_model_v2/best_model"
         
     | 
| 27 | 
         
            +
                finetuned_tokenizer = T5Tokenizer.from_pretrained(finetuned_model_path)
         
     | 
| 28 | 
         
            +
                finetuned_model = T5ForConditionalGeneration.from_pretrained(finetuned_model_path).to(device)
         
     | 
| 29 | 
         | 
| 30 | 
         
             
                # 加载困惑度模型
         
     | 
| 31 | 
         
             
                perplexity_model = GPT2LMHeadModel.from_pretrained("gpt2").to(device)
         
     |