Instructions to use DmitryYarov/plato_2024_1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DmitryYarov/plato_2024_1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DmitryYarov/plato_2024_1.0")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DmitryYarov/plato_2024_1.0") model = AutoModelForCausalLM.from_pretrained("DmitryYarov/plato_2024_1.0") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DmitryYarov/plato_2024_1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DmitryYarov/plato_2024_1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DmitryYarov/plato_2024_1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DmitryYarov/plato_2024_1.0
- SGLang
How to use DmitryYarov/plato_2024_1.0 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 "DmitryYarov/plato_2024_1.0" \ --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": "DmitryYarov/plato_2024_1.0", "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 "DmitryYarov/plato_2024_1.0" \ --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": "DmitryYarov/plato_2024_1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DmitryYarov/plato_2024_1.0 with Docker Model Runner:
docker model run hf.co/DmitryYarov/plato_2024_1.0
essays
This model is a fine-tuned version of sberbank-ai/rugpt3small_based_on_gpt2 on a plato_full_russ It achieves the following results on the evaluation set:
- Loss: 3.1957
- Accuracy: 0.3682
Model description
More information needed
Intended uses & limitations
Biases: Cultural Bias: The model may reflect biases present in the translations of Plato's texts. Since translations can vary significantly based on the translator's interpretation, the model might inadvertently favor certain philosophical interpretations over others. Representation Bias: If the training data predominantly features specific translations or interpretations, the model may lack diversity in its responses, potentially neglecting alternative philosophical viewpoints. Ethical Dilemmas: Misinterpretation of Philosophical Ideas: The model could generate responses that misrepresent Plato's ideas or present them out of context. This raises concerns about the accuracy and integrity of philosophical discourse. Responsibility for Generated Content: There is an ethical question regarding who is responsible for the content generated by the model. If it produces harmful or misleading information, accountability becomes a significant issue. Limitations: Contextual Understanding: While the model can generate text based on patterns in the training data, it may lack true understanding of philosophical concepts, leading to superficial or nonsensical outputs. Dependence on Training Data: The quality and comprehensiveness of the training data directly impact the model's performance. If certain dialogues or themes from Plato are underrepresented, this will limit the model's ability to generate relevant responses.
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 2
- eval_batch_size: 8
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 8
- optimizer: Use adafactor and the args are: No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 10.0
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 2.7233 | 7.6046 | 500 | 3.1864 | 0.3682 |
Framework versions
- Transformers 4.46.0.dev0
- Pytorch 2.4.1+cu121
- Datasets 3.0.1
- Tokenizers 0.20.1
using
!pip install --upgrade transformers huggingface_hub
from transformers import pipeline
Load the model from Hugging Face Hub
model_name = "DmitryYarov/plato_2024_1.0" # Replace with your actual model ID pipe = pipeline("text-generation", model=model_name)
Define a prompt for generating philosophical text
prompt = "Что такое добро и Благо, Сократ? Объясните с философской точки зрения."
Generate text with beam search
output = pipe( prompt, repetition_penalty=2.0, no_repeat_ngram_size=2, max_length=200, num_return_sequences=3, # Generate multiple responses num_beams=5, # Use beam search with a specified number of beams temperature=0.7, # Adjust for creativity top_k=50, # Limit to top-k words top_p=0.95, # Use nucleus sampling truncation=True # Ensure truncation if needed )
Print all generated texts
for i, response in enumerate(output): print(f"Response {i+1}: {response['generated_text']}\n")
answers:
Response 1: Что такое добро и Благо, Сократ? Объясните с философской точки зрения. Сократ. Добро — это то, что мы называем благом, а не тем, чем оно названо. Если бы кто-нибудь спросил меня: «Какое благо ты называешь добром?» — я ответил бы: доброе. А если бы он спросил его: какое же из этих двух слов ты разумеешь добром? Я отвечал бы ему: добро. И вот теперь, когда он спрашивает меня о том же самом, я сказал бы следующее: зло. Итак, добрый человек должен быть добр, потому что иначе он не был бы человеком добрым. Так ли тебе кажется? Федон, или О должном 709 Чужеземец.. Но ведь ты утверждаешь, будто есть два вида добра: один — наилучший, другой — худший. Не так ли? Или ты не согласен со мной в этом вопросе? Скажи же мне, ради Зевса, каким образом
Response 2: Что такое добро и Благо, Сократ? Объясните с философской точки зрения. Сократ. Добро — это то, что мы называем благом, а не тем, чем оно названо. Если бы кто-нибудь спросил меня: «Какое благо ты называешь добром?» — я ответил бы: доброе. А если бы он спросил его: какое же из этих двух слов ты разумеешь добром? Я отвечал бы ему: добро. И вот теперь, когда он спрашивает меня о том же самом, я сказал бы следующее: зло. Итак, добрый человек должен быть добр, потому что иначе он не был бы человеком добрым. Так ли тебе кажется? Федон, или О должном 709 Чужеземец.. Но ведь ты утверждаешь, будто есть два вида добра: один — наилучший, другой — худший. Не так ли? Или ты не согласен со мной в этом вопросе? Впрочем, может быть, для тебя будет лучше,
Response 3: Что такое добро и Благо, Сократ? Объясните с философской точки зрения. Сократ. Добро — это то, что мы называем благом, а не тем, чем оно названо. Если бы кто-нибудь спросил меня: «Какое благо ты называешь добром?» — я ответил бы: доброе. А если бы он спросил его: какое же из этих двух слов ты разумеешь добром? Я отвечал бы ему: добро. И вот теперь, когда он спрашивает меня о том же самом, я сказал бы следующее: зло. Итак, добрый человек должен быть добр, потому что иначе он не был бы человеком добрым. Так ли тебе кажется? Федон, или О должном 709 Чужеземец.. Но ведь ты утверждаешь, будто есть два вида добра: один — наилучший, другой — худший. Не так ли? Или ты не согласен со мной в этом вопросе? Впрочем, может быть, ты и прав. Ведь
- Downloads last month
- 4
Model tree for DmitryYarov/plato_2024_1.0
Base model
ai-forever/rugpt3small_based_on_gpt2