Model Trained Using AutoTrain

This model was trained using AutoTrain. For more information, please visit AutoTrain.

Usage


import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_path = "deepseek-ai/DeepSeek-R1-Distill-Llama-8B"
lora_model_path = "NoirZangetsu/DeepSeek-8B-turkishlaw-sustainbility"

tokenizer = AutoTokenizer.from_pretrained(lora_model_path)

base_model = AutoModelForCausalLM.from_pretrained(
    base_model_path,
    device_map="auto",
    torch_dtype=torch.float16
)

model = PeftModel.from_pretrained(base_model, lora_model_path).eval()

conversation = []

print("Chatbot'a hoş geldiniz. Hukuk ve sürdürebilirlik hakkında sorularınızı sorabilirsiniz. Çıkmak için 'exit' yazınız.")

while True:
    user_input = input("Siz: ")
    if user_input.lower() in ['exit', 'quit']:
        print("Chatbot: Görüşmek üzere!")
        break

    conversation.append({"role": "user", "content": user_input})

    input_ids = tokenizer.apply_chat_template(
        conversation=conversation,
        tokenize=True,
        add_generation_prompt=True,
        return_tensors='pt'
    )

    input_ids = input_ids.to('cuda')

    output_ids = model.generate(input_ids, max_length=512)

    response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True).strip()

    print("Chatbot:", response)

    conversation.append({"role": "assistant", "content": response})
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for NoirZangetsu/DeepSeek-8B-turkish-training-LoRA-2

Finetuned
(90)
this model