Instructions to use NepaliAI/NFT-6.9k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NepaliAI/NFT-6.9k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NepaliAI/NFT-6.9k")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("NepaliAI/NFT-6.9k") model = AutoModelForSeq2SeqLM.from_pretrained("NepaliAI/NFT-6.9k") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use NepaliAI/NFT-6.9k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NepaliAI/NFT-6.9k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NepaliAI/NFT-6.9k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NepaliAI/NFT-6.9k
- SGLang
How to use NepaliAI/NFT-6.9k 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 "NepaliAI/NFT-6.9k" \ --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": "NepaliAI/NFT-6.9k", "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 "NepaliAI/NFT-6.9k" \ --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": "NepaliAI/NFT-6.9k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NepaliAI/NFT-6.9k with Docker Model Runner:
docker model run hf.co/NepaliAI/NFT-6.9k
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
Model Card for Model ID: NepaliAI/NFT-6.9k
Model Details
Model Description
The NepaliAI/NFT-6.9k model is based on the BART (Bidirectional and Auto-Regressive Transformers) architecture, specifically utilizing the facebook/bart-large-xsum pre-trained model. It has been fine-tuned on the Nepali health-related question-answering dataset.
Intended Use
The model is designed to generate answers to health-related questions provided by users. The primary language for input and output is Nepali.
Training Data
The model has been fine-tuned on the NepaliAI health-related question-answering dataset, derived from the NepaliAI/Nepali-Health-QA dataset. The training data consists of pairs of health-related questions and their corresponding answers.
Training Procedure
The model was trained for 5 epochs with the following training parameters:
- Learning Rate: 5e-5
- Batch Size: 2
- Gradient Accumulation Steps: 4
- FP16 (mixed-precision training): Enabled
- Optimizer: AdamW with weight decay
The training loss consistently decreased, indicating successful learning.
Use case:
from transformers import BartTokenizer, BartForConditionalGeneration
# Load the trained model
model = BartForConditionalGeneration.from_pretrained("NepaliAI/NFT-6.9k")
# Load the tokenizer for generating new output
tokenizer = BartTokenizer.from_pretrained("NepaliAI/NFT-6.9k")
# Example text
input_text = "के म मेरो महिनावारीको समयमा स्ट्रेप थ्रोटको लागि डाक्टरले तोकेको औषधि लिन सक्छु?"
# Tokenize the input
inputs = tokenizer(input_text, return_tensors="pt", max_length=128, truncation=True)
# Generate text
generated_text = model.generate(**inputs, max_length=256, top_p=0.95, top_k=50, do_sample=True, temperature=0.7, num_return_sequences=1, no_repeat_ngram_size=2)
# Decode the generated text
generated_response = tokenizer.batch_decode(generated_text, skip_special_tokens=True)[0]
# Print the generated response
print("Generated Response:", generated_response)
Evaluation
Metrics
No evaluation performed yet.
Limitations
- The model's knowledge is limited to the training data, and it might not generalize well to unseen health-related questions.
- The model's responses might vary based on the complexity and diversity of input questions.
Ethical Considerations
Intended Use
#The model is intended for informational purposes related to health. Users should be aware that the model's responses are generated based on patterns learned from the training data and might not substitute professional medical advice.
Bias
Care should be taken to minimize biases present in the training data. Diverse and representative datasets are crucial to mitigate biases in the model's responses.
Privacy
The model does not store or retain user input. However, users are advised not to input sensitive or personally identifiable information.
Future Directions
- Continuous improvement through hyperparameter tuning and model architecture exploration.
- Expansion of the training dataset to enhance the model's knowledge and performance.
- Adaptation of the model for other fields of Nepali datasets, starting with health-related datasets.
License
This model is made available under the Hugging Face Model Hub's community guidelines and the license specified by the facebook/bart-large-xsum pre-trained model.
- Downloads last month
- 7