Instructions to use erfanzar/LinguaMatic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erfanzar/LinguaMatic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erfanzar/LinguaMatic")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("erfanzar/LinguaMatic") model = AutoModelForCausalLM.from_pretrained("erfanzar/LinguaMatic") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use erfanzar/LinguaMatic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erfanzar/LinguaMatic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erfanzar/LinguaMatic", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erfanzar/LinguaMatic
- SGLang
How to use erfanzar/LinguaMatic 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 "erfanzar/LinguaMatic" \ --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": "erfanzar/LinguaMatic", "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 "erfanzar/LinguaMatic" \ --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": "erfanzar/LinguaMatic", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use erfanzar/LinguaMatic with Docker Model Runner:
docker model run hf.co/erfanzar/LinguaMatic
LinguaMatic
LinguaMatic is an advanced AI model designed to handle a wide range of Natural Language Processing (NLP) tasks. With its powerful capabilities, LinguaMatic can assist with tasks such as text classification, sentiment analysis, language translation, question answering, and much more.
EasyDel
The model is finetuned Using a custom version of UltraChat on TPU-v4 POD using EasyDel
Prompting Method
LinguaMatic utilizes the llama2 prompting method to generate responses. This method, named after the friendly and intelligent llama, enhances the model's ability to engage in meaningful conversations. The prompt_model function provided below demonstrates how the llama2 prompting method is implemented:
def prompt_model(message: str, chat_history,
system_prompt: str) -> str:
do_strip = False
texts = [f'<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n']
for user_input, response in chat_history:
user_input = user_input.strip() if do_strip else user_input
do_strip = True
texts.append(f'{user_input} [/INST] {response.strip()} </s><s>[INST] ')
message = message.strip() if do_strip else message
texts.append(f'{message} [/INST]')
return ''.join(texts)
The prompt_model function takes a message as input, along with the chat_history and system_prompt. It generates a formatted text that includes the system prompt, user inputs, and the current message. This approach allows LinguaMatic to maintain context and provide more coherent and context-aware responses.
Contributing
We welcome contributions to enhance LinguaMatic's capabilities and improve its performance. If you encounter any issues or have suggestions for improvement, please feel free to submit a pull request or open an issue on EasyDel GitHub repository.
- Downloads last month
- 11