Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,24 @@
|
|
1 |
import streamlit as st
|
2 |
-
from
|
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
|
10 |
-
|
|
|
|
|
|
|
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
|
15 |
-
response =
|
16 |
-
|
|
|
|
|
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 = {
|