Views
No views yet
1# Download the model
2wget https://huggingface.co/pavishanth-sujeevan/llama-3.2-3b-english-therapy-GGUF/resolve/main/model.gguf
3
4# Run inference
5./llama-cli -m model.gguf -p "I'm feeling anxious about my future" -n 2001from llama_cpp import Llama
2
3llm = Llama(
4 model_path="model.gguf",
5 n_ctx=2048,
6 n_threads=4,
7 n_gpu_layers=35
8)
9
10output = llm(
11 "User: I'm feeling stressed about work.\nTherapist:",
12 max_tokens=200,
13 temperature=0.7,
14 top_p=0.9
15)
16
17print(output["choices"][0]["text"])1import streamlit as st
2from llama_cpp import Llama
3
4@st.cache_resource
5def load_model():
6 return Llama(model_path="model.gguf", n_ctx=2048, n_gpu_layers=35)
7
8llm = load_model()
9user_input = st.text_input("How are you feeling?")
10
11if user_input:
12 response = llm(f"User: {user_input}\nTherapist:", max_tokens=200)
13 st.write(response["choices"][0]["text"])