Spaces:
				
			
			
	
			
			
		Running
		
			on 
			
			Zero
	
	
	
			
			
	
	
	
	
		
		
		Running
		
			on 
			
			Zero
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -11,21 +11,19 @@ from threading import Thread 
     | 
|
| 11 | 
         | 
| 12 | 
         
             
            DESCRIPTION = '''
         
     | 
| 13 | 
         
             
            <div>
         
     | 
| 14 | 
         
            -
            <h1 style="text-align: center;">非公式Llama- 
     | 
| 15 | 
         
            -
            <p>tokyotech-llm/Llama- 
     | 
| 16 | 
         
             
            </div>
         
     | 
| 17 | 
         
             
            '''
         
     | 
| 18 | 
         | 
| 19 | 
         
             
            LICENSE = """
         
     | 
| 20 | 
         
             
            <p/>
         
     | 
| 21 | 
         | 
| 22 | 
         
            -
            ---
         
     | 
| 23 | 
         
            -
            Built with Meta Llama 3.1
         
     | 
| 24 | 
         
             
            """
         
     | 
| 25 | 
         | 
| 26 | 
         
             
            PLACEHOLDER = """
         
     | 
| 27 | 
         
             
            <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
         
     | 
| 28 | 
         
            -
               <h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;"> 
     | 
| 29 | 
         
             
               <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">なんでもきいてね</p>
         
     | 
| 30 | 
         
             
            </div>
         
     | 
| 31 | 
         
             
            """
         
     | 
| 
         @@ -66,7 +64,6 @@ def chat_llama3_8b(message: str, 
     | 
|
| 66 | 
         
             
                    str: The generated response.
         
     | 
| 67 | 
         
             
                """
         
     | 
| 68 | 
         
             
                conversation = []
         
     | 
| 69 | 
         
            -
                conversation.append({"role": "system", "content": "あなたは誠実で優秀な日本人のアシスタントです。日本語で聞かれた場合、必ず日本語で返答してください。"})
         
     | 
| 70 | 
         
             
                for user, assistant in history:
         
     | 
| 71 | 
         
             
                    conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
         
     | 
| 72 | 
         
             
                conversation.append({"role": "user", "content": message})
         
     | 
| 
         | 
|
| 11 | 
         | 
| 12 | 
         
             
            DESCRIPTION = '''
         
     | 
| 13 | 
         
             
            <div>
         
     | 
| 14 | 
         
            +
            <h1 style="text-align: center;">非公式Gemma-2-Llama-Swallow-27b-it-v0.1</h1>
         
     | 
| 15 | 
         
            +
            <p>tokyotech-llm/Gemma-2-Llama-Swallow-27b-it-v0.1の非公式デモだよ。 <a href="https://huggingface.co/tokyotech-llm/Gemma-2-Llama-Swallow-27b-it-v0.1"><b>tokyotech-llm/Gemma-2-Llama-Swallow-27b-it-v0.1</b></a>.</p>
         
     | 
| 16 | 
         
             
            </div>
         
     | 
| 17 | 
         
             
            '''
         
     | 
| 18 | 
         | 
| 19 | 
         
             
            LICENSE = """
         
     | 
| 20 | 
         
             
            <p/>
         
     | 
| 21 | 
         | 
| 
         | 
|
| 
         | 
|
| 22 | 
         
             
            """
         
     | 
| 23 | 
         | 
| 24 | 
         
             
            PLACEHOLDER = """
         
     | 
| 25 | 
         
             
            <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
         
     | 
| 26 | 
         
            +
               <h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">Gemma-2-Llama-Swallow</h1>
         
     | 
| 27 | 
         
             
               <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">なんでもきいてね</p>
         
     | 
| 28 | 
         
             
            </div>
         
     | 
| 29 | 
         
             
            """
         
     | 
| 
         | 
|
| 64 | 
         
             
                    str: The generated response.
         
     | 
| 65 | 
         
             
                """
         
     | 
| 66 | 
         
             
                conversation = []
         
     | 
| 
         | 
|
| 67 | 
         
             
                for user, assistant in history:
         
     | 
| 68 | 
         
             
                    conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
         
     | 
| 69 | 
         
             
                conversation.append({"role": "user", "content": message})
         
     |