Instructions to use foufou26/malin with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use foufou26/malin with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="foufou26/malin")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("foufou26/malin") model = AutoModelForCausalLM.from_pretrained("foufou26/malin", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use foufou26/malin with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "foufou26/malin" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "foufou26/malin", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/foufou26/malin
- SGLang
How to use foufou26/malin with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "foufou26/malin" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "foufou26/malin", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "foufou26/malin" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "foufou26/malin", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use foufou26/malin with Docker Model Runner:
docker model run hf.co/foufou26/malin
Work by Aymen Fourati
Outline :
Introduction
Technical stack and discussions
Creation of the database
1) Introduction:
We're proposing a proof of concept for an automatic responder to customer feedback in the restaurant industry.
2) Technical stack and discussions :
The model we've chosen to fine-tune is gpt2, the open source model from open ai. For this fair, we're using HuggingFace's Transformer library:
3) Database creation :
In the absence of a reference database, we'll create a dataset from a comment repo borrowed from Kaggle: https://www.kaggle.com/datasets/vigneshwarsofficial/reviews/data
We choose to structure our dataset as follows:
{
keywords : string [], // word tables to contextualize the customer review.
comment : string, // the customer review from the Kaggle dataset.
reply : string, // a reply generated by gpt 3.5 for model training.
satisfaction : Binary // 1 if positive 0 otherwise. This attribute plays no role in model training, but it does allow us to balance classes correctly in the pre-processing phase.
}
There are three main types of keywords:
type 1: Restaurant : The first keyword will always be "restaurant", in order to introduce scalability to the dataset (for example, by expanding the dataset to include other services such as Bar or Café, without disrupting the model's performance).
type 2 : Contextualization : like a hashtag to contextualize the customer review, for example if the review comes from a comment on a special offer on a facebook post, we'll have a keyword "20% promo".
type 3 : Comment subset : Various words appearing in the comment (which could be generated by intersecting with a database of keywords we deem interesting).
Examples : interesting words :["chicken soup", "kids menu", "pizza", "hamburger", "beer", "steak"...]
comment: "Amazing chicken soup! However, The steak was a bit raw.."
--> keywords ["restaurant", "chicken soup", "steak", "saturday night"]
Here's a subset of that dataset:
{
"keywords": ["restaurant", "positive experience", "grand reopening event", "new menu launch"],
"comment": "Overall, I like this place a lot.",
"reply": "We're thrilled to hear that you enjoyed your experience! Thank you for your positive feedback. The grand reopening event and new menu launch have been exciting for us, and we look forward to serving you again.",
"satisfaction": 1
},
{
"keywords": ["restaurant", "delightful first visit", "chef's special creations"],
"comment": "My first visit to Hiro was a delight!",
"reply": "We're thrilled to hear that your first visit was delightful! Our chef has introduced special creations that we hope will continue to impress you. Thank you for choosing Hiro, and we look forward to your next visit.",
"satisfaction": 1
},
{
"keywords": ["restaurant", "ample portions", "special pricing", "culinary innovations"],
"comment": "Ample portions and good prices.",
"reply": "Thank you for your positive feedback on our portions and prices! We're excited to share that we're constantly working on culinary innovations to enhance your dining experience.",
"satisfaction": 1
},
Here are few exemples you can test :
keywords = ["restaurant","negative experience"] comment = "This place is way too overpriced for mediocre food."
keywords = ["restaurant","positive experience","good service"] comment = "Service was fine and the waitress was friendly."
keywords = ["restaurant","good experience"] comment = "If you want healthy authentic or ethic food, try this place."
keywords = ["restaurant","good waitress"] comment = "Waitress was sweet and funny."
keywords = ["restaurant","Bad service"] comment = "We've have gotten a much better service from the pizza place next door than the services we received from this restaurant."
Thank you for your time !
- Downloads last month
- 15