Instructions to use LOHAMEIT/BITShyd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Adapters
How to use LOHAMEIT/BITShyd with Adapters:
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("undefined") model.load_adapter("LOHAMEIT/BITShyd", set_active=True) - llama-cpp-python
How to use LOHAMEIT/BITShyd with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="LOHAMEIT/BITShyd", filename="unsloth.Q8_0.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use LOHAMEIT/BITShyd with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf LOHAMEIT/BITShyd:Q8_0 # Run inference directly in the terminal: llama-cli -hf LOHAMEIT/BITShyd:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf LOHAMEIT/BITShyd:Q8_0 # Run inference directly in the terminal: llama-cli -hf LOHAMEIT/BITShyd:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf LOHAMEIT/BITShyd:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf LOHAMEIT/BITShyd:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf LOHAMEIT/BITShyd:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf LOHAMEIT/BITShyd:Q8_0
Use Docker
docker model run hf.co/LOHAMEIT/BITShyd:Q8_0
- LM Studio
- Jan
- vLLM
How to use LOHAMEIT/BITShyd with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LOHAMEIT/BITShyd" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LOHAMEIT/BITShyd", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LOHAMEIT/BITShyd:Q8_0
- Ollama
How to use LOHAMEIT/BITShyd with Ollama:
ollama run hf.co/LOHAMEIT/BITShyd:Q8_0
- Unsloth Studio new
How to use LOHAMEIT/BITShyd with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for LOHAMEIT/BITShyd to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for LOHAMEIT/BITShyd to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for LOHAMEIT/BITShyd to start chatting
- Docker Model Runner
How to use LOHAMEIT/BITShyd with Docker Model Runner:
docker model run hf.co/LOHAMEIT/BITShyd:Q8_0
- Lemonade
How to use LOHAMEIT/BITShyd with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull LOHAMEIT/BITShyd:Q8_0
Run and chat with the model
lemonade run user.BITShyd-Q8_0
List all available models
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
BITShyd: AI-Enhanced Facial Expression & Mental Health Counseling
Project Summary
BITShyd is an innovative AI project developed at BITS Pilani, Hyderabad, designed to bridge the gap between facial expression recognition and mental health counseling. Using a combination of conversational AI fine-tuned on the Amod/mental_health_counseling_conversations dataset and real-time facial expression analysis, the model provides contextual responses tailored to the emotional state of the user. This empathetic AI supports mental health applications and interactive emotional support systems.
Key Features and Technology
- Facial Expression Recognition: Detects emotions (happy, sad, angry, surprised, etc.) using real-time video input, enhanced with
face-api.js. - Conversational AI for Mental Health: The model generates empathetic, supportive responses in mental health contexts, using fine-tuning on the Amod dataset.
- Low-Rank Adaptation (LoRA) and Unsloth Fine-Tuning: These techniques streamline adaptation and latency, allowing use across hardware setups, from personal devices to cloud platforms.
Technical Overview
- Base Model: LLaMA 3.1 (8B parameters) on Hugging Face
- Dataset: Amod/mental_health_counseling_conversations
- Optimization: LoRA for lightweight tuning and Unsloth for improved inference latency
- Supported Use Cases: Virtual mental health counseling, empathetic AI interactions, real-time emotional analysis
Fine-Tuning Details
The model utilizes LoRA and Unsloth fine-tuning, which make it adaptable to a range of devices by reducing the resource load without compromising on performance:
- Parameter-Efficient Training: LoRA keeps the model’s core knowledge while adapting to new data, critical for sensitive applications like mental health.
- Latency Optimization: Unsloth helps reduce response time, essential for real-time interaction.
- Training Configurations:
| Parameter | Value |
|---|---|
| Model Size | 8 Billion Parameters |
| Epochs | 3 |
| Learning Rate | 5e-5 |
| Batch Size | 8 |
| Dataset | Amod/mental_health_counseling_conversations |
| Optimizations | LoRA and Unsloth |
Code for Facial Expression Recognition
Below is a snippet using face-api.js for real-time expression detection and emoji overlay based on emotions detected:
const video = document.getElementById('video');
const expressionsToEmoji = { happy: '😊', sad: '😢', angry: '😠', surprised: '😮', fearful: '😨' };
async function loadModels() {
await faceapi.nets.tinyFaceDetector.loadFromUri('models');
await faceapi.nets.faceExpressionNet.loadFromUri('models');
await startVideo();
}
async function startVideo() {
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
video.srcObject = stream;
}
async function detectFaces() {
const detections = await faceapi.detectAllFaces(video, new faceapi.TinyFaceDetectorOptions())
.withFaceExpressions();
// Render emoji based on emotion
detections.forEach(detection => {
const expressions = detection.expressions;
const topExpression = Object.keys(expressions).reduce((a, b) => expressions[a] > expressions[b] ? a : b);
const emoji = expressionsToEmoji[topExpression] || '🙂';
// Code to overlay emoji on video feed...
});
}
loadModels();
Pros & Cons of Fine-Tuning Techniques
Advantages
- Efficient Adaptability: LoRA enables fine-tuning with minimal additional parameters, making the model flexible for different datasets without extensive resources.
- Reduced Latency: Unsloth optimizes real-time response speed, vital for real-time interactions in mental health applications.
- Scalability: These techniques allow the model to run on a range of devices, expanding access to diverse user bases.
Disadvantages
- Limited Transfer to Drastically Different Domains: LoRA and Unsloth are efficient within the trained domain but may struggle with applications vastly different from the original training data.
- Computational Constraints: Although reduced, fine-tuning large models can still demand significant resources for high-quality performance in real-world applications.
Why Building Projects is Crucial Beyond DSA Skills
Building real-world projects like BITShyd is invaluable compared to simply mastering algorithms and data structures (DSA). While DSA provides foundational skills for coding efficiency, project-based learning fosters critical skills like problem-solving, innovation, and practical application. These skills are essential in building technology that interacts with the real world, like empathetic AI. In a 9-to-5 job, growth is often linear, but personal projects allow you to create, innovate, and potentially develop tech that impacts millions—especially in fields like AI, where emotional intelligence and empathy are groundbreaking.
BITShyd Project represents this mindset, and we encourage developers to focus on projects that break conventional boundaries and offer more than predefined answers to problems.I aim to encourage building, experimenting, and understanding the end-to-end process of creating impactful technology.
Future Enhancements
- Expanded Emotion Detection: Plan to integrate a broader set of emotional expressions and even body language for deeper analysis.
- Deployment Options: Considering integration with cloud platforms for broad accessibility and robust interaction.
- Error Handling: Addressing the recent challenge with the Ollama API, ensuring smooth integration for stable performance.
Canva Link to PPT https://www.canva.com/design/DAGWDV6SGIw/zCkKWQDUulSIS4acv5cKmg/view?utm_content=DAGWDV6SGIw&utm_campaign=designshare&utm_medium=link&utm_source=editor
- Downloads last month
- 11
8-bit
Model tree for LOHAMEIT/BITShyd
Base model
meta-llama/Llama-3.1-8B
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="LOHAMEIT/BITShyd", filename="unsloth.Q8_0.gguf", )