1
stars
9
commits
1
repos using this model
1
linked in READMEs
Jun 15, 2025
updated
Bu model, Llama-3-8B temel modeli üzerine LoRA (Low-Rank Adaptation) yöntemi ile Türkçe tıbbi aciliyet verileri üzerinde fine-tune edilmiştir. Model, hasta şikayetlerini analiz ederek aciliyet seviyesi değerlendirmesi yapar.
import os
from llama_cpp import Llama
def load_model(path):
try:
print(f"🔄 Model yükleniyor: {os.path.basename(path)}")
model = Llama(model_path=path, n_ctx=4096, n_threads=8, verbose=False, n_gpu_layers=0)
print("✅ Model yüklendi")
return model
except Exception as e:
print(f"❌ Yükleme hatası: {e}")
return None
def run_inference(model, prompt):
try:
result = model(prompt=prompt, max_tokens=300, temperature=0.5, stop=["<|im_end|>"], echo=False)
return result['choices'][0]['text'].strip()
except Exception as e:
print(f"❌ Inference hatası: {e}")
return None
def main():
print("🚀 GGUF Model Chat - Çıkmak için 'q' yaz")
path = input("Model dosya yolu (varsayılan: model.gguf): ").strip() or "model.gguf"
if not os.path.exists(path):
print(f"❌ Dosya bulunamadı: {path}")
return
model = load_model(path)
if not model:
return
while True:
user_input = input("\n👤 Siz: ").strip()
if user_input.lower() in ['q', 'quit', 'çık', 'exit']:
break
if not user_input:
continue
prompt = f"""<|im_start|>system
Sen tıbbi aciliyet değerlendirmesi yapan bir asistansın.
<|im_end|>
<|im_start|>user
{user_input}
<|im_end|>
<|im_start|>assistant
"""
print("🔄 Düşünüyor...")
response = run_inference(model, prompt)
print(f"🤖 Asistan: {response}" if response else "❌ Yanıt alınamadı")
if __name__ == "__main__":
try:
main()
except ImportError:
print("❌ llama-cpp-python eksik! Yüklemek için:\n")
print("pip install llama-cpp-python")
# Kurulum komutları:
"""
# CPU versiyonu:
pip install llama-cpp-python
# CUDA GPU desteği:
pip install llama-cpp-python[cuda]
# Mac Metal desteği:
pip install llama-cpp-python[metal]
# Manuel derleme ile:
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
"""
@misc{medical_emergency_llama3,
title={Tıbbi Aciliyet Değerlendirme Modeli - Llama-3 Turkish Medical},
author={[Doguser Yarar]},
year={2025},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/dousery/turkish-medical-triage-llama3-gguf}}
}
v1.0 (Aralık 2024)
Bu model tıbbi tavsiye vermez. Sağlık sorunlarınız için mutlaka bir sağlık profesyoneline başvurun.
9 commits
1
stars
9
commits
1
repos using this model
1
linked in READMEs
Jun 15, 2025
updated
Bu model, Llama-3-8B temel modeli üzerine LoRA (Low-Rank Adaptation) yöntemi ile Türkçe tıbbi aciliyet verileri üzerinde fine-tune edilmiştir. Model, hasta şikayetlerini analiz ederek aciliyet seviyesi değerlendirmesi yapar.
import os
from llama_cpp import Llama
def load_model(path):
try:
print(f"🔄 Model yükleniyor: {os.path.basename(path)}")
model = Llama(model_path=path, n_ctx=4096, n_threads=8, verbose=False, n_gpu_layers=0)
print("✅ Model yüklendi")
return model
except Exception as e:
print(f"❌ Yükleme hatası: {e}")
return None
def run_inference(model, prompt):
try:
result = model(prompt=prompt, max_tokens=300, temperature=0.5, stop=["<|im_end|>"], echo=False)
return result['choices'][0]['text'].strip()
except Exception as e:
print(f"❌ Inference hatası: {e}")
return None
def main():
print("🚀 GGUF Model Chat - Çıkmak için 'q' yaz")
path = input("Model dosya yolu (varsayılan: model.gguf): ").strip() or "model.gguf"
if not os.path.exists(path):
print(f"❌ Dosya bulunamadı: {path}")
return
model = load_model(path)
if not model:
return
while True:
user_input = input("\n👤 Siz: ").strip()
if user_input.lower() in ['q', 'quit', 'çık', 'exit']:
break
if not user_input:
continue
prompt = f"""<|im_start|>system
Sen tıbbi aciliyet değerlendirmesi yapan bir asistansın.
<|im_end|>
<|im_start|>user
{user_input}
<|im_end|>
<|im_start|>assistant
"""
print("🔄 Düşünüyor...")
response = run_inference(model, prompt)
print(f"🤖 Asistan: {response}" if response else "❌ Yanıt alınamadı")
if __name__ == "__main__":
try:
main()
except ImportError:
print("❌ llama-cpp-python eksik! Yüklemek için:\n")
print("pip install llama-cpp-python")
# Kurulum komutları:
"""
# CPU versiyonu:
pip install llama-cpp-python
# CUDA GPU desteği:
pip install llama-cpp-python[cuda]
# Mac Metal desteği:
pip install llama-cpp-python[metal]
# Manuel derleme ile:
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
"""
@misc{medical_emergency_llama3,
title={Tıbbi Aciliyet Değerlendirme Modeli - Llama-3 Turkish Medical},
author={[Doguser Yarar]},
year={2025},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/dousery/turkish-medical-triage-llama3-gguf}}
}
v1.0 (Aralık 2024)
Bu model tıbbi tavsiye vermez. Sağlık sorunlarınız için mutlaka bir sağlık profesyoneline başvurun.
9 commits