from transformers import pipeline
import torch
model_id = "MODEL_ADI"
pipe = pipeline(
    "text-generation",
    model=model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto", #device=torch.device("cuda")  # Eğer manuel ayarlamak istersen
)
data = request.json()
user_message = data['message']
outputs = pipe(conversation_history, max_new_tokens=4096)
response = outputs[0]["generated_text"][-1]['content']
print(response)
Yukarıda bir text2text modeli için kod bıraktım burdan referans alabilrisin. Ben api olarak yazmıştım bu sadeleşmiş hali ama en basic hali bu bildiğim kadarıyla. Modeli kullanırken virtualenv ile kullanmayı unutma. Goddamn modeller çok vram istiyor, bizde de para yok bakalım nere kadar gitcez böle böle.