Bey007 commited on
Commit
b893c3a
·
verified ·
1 Parent(s): 058686d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -1,19 +1,24 @@
1
  import streamlit as st
2
- from transformers import pipeline
3
  from gtts import gTTS
4
  from io import BytesIO
5
  import random
6
  import requests
7
  from youtubesearchpython import VideosSearch
8
 
9
- # Initialize the empathy bot pipeline with the new model
10
- empathy_bot = pipeline("text2text-generation", model="featherless-ai-quants/HyunCello-KULLM3-empathy-v1.0-GGUF")
 
 
 
11
 
12
  # Function to process the user's input and generate a dynamic response
13
  def generate_dynamic_response(user_input):
14
- # Generate an empathetic response using the new model
15
- response = empathy_bot(user_input)
16
- empathetic_response = response[0]['generated_text']
 
 
17
 
18
  # Possible activities to suggest
19
  activities = {
 
1
  import streamlit as st
2
+ from llama_cpp import Llama
3
  from gtts import gTTS
4
  from io import BytesIO
5
  import random
6
  import requests
7
  from youtubesearchpython import VideosSearch
8
 
9
+ # Initialize the empathy bot using llama_cpp
10
+ llm = Llama.from_pretrained(
11
+ repo_id="featherless-ai-quants/HyunCello-KULLM3-empathy-v1.0-GGUF",
12
+ filename="HyunCello-KULLM3-empathy-v1.0-IQ4_XS.gguf",
13
+ )
14
 
15
  # Function to process the user's input and generate a dynamic response
16
  def generate_dynamic_response(user_input):
17
+ # Generate an empathetic response using the Llama model
18
+ response = llm.create_chat_completion(
19
+ messages=[{"role": "user", "content": user_input}]
20
+ )
21
+ empathetic_response = response['choices'][0]['message']['content']
22
 
23
  # Possible activities to suggest
24
  activities = {