Instructions to use ZeynepAltundal/Wikipedia with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZeynepAltundal/Wikipedia with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ZeynepAltundal/Wikipedia") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ZeynepAltundal/Wikipedia") model = AutoModelForCausalLM.from_pretrained("ZeynepAltundal/Wikipedia") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ZeynepAltundal/Wikipedia with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ZeynepAltundal/Wikipedia" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZeynepAltundal/Wikipedia", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ZeynepAltundal/Wikipedia
- SGLang
How to use ZeynepAltundal/Wikipedia 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 "ZeynepAltundal/Wikipedia" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZeynepAltundal/Wikipedia", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ZeynepAltundal/Wikipedia" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZeynepAltundal/Wikipedia", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ZeynepAltundal/Wikipedia with Docker Model Runner:
docker model run hf.co/ZeynepAltundal/Wikipedia
Model Overview:
This model is a fine-tuned version of the "ytu-ce-cosmos/turkish-gpt2-medium-350m-instruct-v0.1", designed specifically for Turkish Question-Answering (Q&A). The fine-tuning process utilized a custom dataset generated from Turkish Wikipedia articles, focusing on factual knowledge.
Base Model: ytu-ce-cosmos/turkish-gpt2-medium-350m-instruct-v0.1 Fine-Tuned Dataset: Custom Turkish Q&A dataset Evaluation Loss: 2.1461 (on the validation dataset)
Quick Start
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "./fine_tuned_model" # Replace with your Hugging Face model path if uploaded
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
question = "Kamu sosyolojisi nedir?"
input_ids = tokenizer(question, return_tensors="pt").input_ids
output = model.generate(
input_ids=input_ids,
max_length=50,
num_return_sequences=1,
temperature=0.7
)
response = tokenizer.decode(output[0], skip_special_tokens=True)
print(f"Question: {question}")
print(f"Answer: {response}")
Training Details:
Dataset Source: Custom dataset generated from Turkish Wikipedia Number of Training Examples: 2,606 Training Dataset Size: 2,084 (80%) Validation Dataset Size: 522 (20%) Number of Epochs: 3 Batch Size: 8 Learning Rate: 5e-5 Evaluation Loss: 2.1461
- Downloads last month
- 1
Model tree for ZeynepAltundal/Wikipedia
Base model
ytu-ce-cosmos/turkish-gpt2-medium
docker model run hf.co/ZeynepAltundal/Wikipedia