Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	
		kz209
		
	commited on
		
		
					Commit 
							
							·
						
						c5b9462
	
1
								Parent(s):
							
							3f40f6e
								
update dataset
Browse files- pages/summarization_playground.py +3 -2
 - utils/data.py +2 -2
 
    	
        pages/summarization_playground.py
    CHANGED
    
    | 
         @@ -34,7 +34,7 @@ Back in Boston, Kidd is going to rely on Lively even more. He'll play close to 3 
     | 
|
| 34 | 
         
             
            }
         
     | 
| 35 | 
         | 
| 36 | 
         
             
            def generate_answer(sources, model_name, prompt):
         
     | 
| 37 | 
         
            -
                content = prompt + '\n{' + sources + '}\n\ 
     | 
| 38 | 
         
             
                global __model_on_gpu__
         
     | 
| 39 | 
         | 
| 40 | 
         
             
                if __model_on_gpu__ != model_name:
         
     | 
| 
         @@ -60,7 +60,8 @@ def process_input(input_text, model_selection, prompt): 
     | 
|
| 60 | 
         | 
| 61 | 
         
             
            def update_input(example):
         
     | 
| 62 | 
         
             
                if example == random_label:
         
     | 
| 63 | 
         
            -
                     
     | 
| 
         | 
|
| 64 | 
         
             
                return examples[example]
         
     | 
| 65 | 
         | 
| 66 | 
         
             
            def create_summarization_interface():
         
     | 
| 
         | 
|
| 34 | 
         
             
            }
         
     | 
| 35 | 
         | 
| 36 | 
         
             
            def generate_answer(sources, model_name, prompt):
         
     | 
| 37 | 
         
            +
                content = prompt + '\n{' + sources + '}\n\nsummary:'
         
     | 
| 38 | 
         
             
                global __model_on_gpu__
         
     | 
| 39 | 
         | 
| 40 | 
         
             
                if __model_on_gpu__ != model_name:
         
     | 
| 
         | 
|
| 60 | 
         | 
| 61 | 
         
             
            def update_input(example):
         
     | 
| 62 | 
         
             
                if example == random_label:
         
     | 
| 63 | 
         
            +
                    datapoint = random.choice(dataset)
         
     | 
| 64 | 
         
            +
                    return datapoint['section_text'] + '\n\nDialogue:' + datapoint['dialogue']
         
     | 
| 65 | 
         
             
                return examples[example]
         
     | 
| 66 | 
         | 
| 67 | 
         
             
            def create_summarization_interface():
         
     | 
    	
        utils/data.py
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 1 | 
         
             
            from datasets import load_dataset 
         
     | 
| 2 | 
         
            -
            dialogsum = load_dataset(' 
     | 
| 3 | 
         
            -
            dataset = list(dialogsum['train']) 
     | 
| 4 | 
         | 
| 
         | 
|
| 1 | 
         
             
            from datasets import load_dataset 
         
     | 
| 2 | 
         
            +
            dialogsum = load_dataset('har1/MTS_Dialogue-Clinical_Note')
         
     | 
| 3 | 
         
            +
            dataset = list(dialogsum['train'])
         
     | 
| 4 | 
         |