Text Generation
Transformers
Safetensors
Thai
English
qwen2
text-generation-inference
sft
trl
4-bit precision
bitsandbytes
LoRA
Fine-Tuning with LoRA
LLM
GenAI
NT GenAI
ntgenai
lahnmah
NT Thai GPT
ntthaigpt
medical
medtech
HealthGPT
หลานม่า
NT Academy
conversational
Inference Endpoints
4-bit precision
Update README.md
Browse files
README.md
CHANGED
@@ -90,33 +90,26 @@ This model can be used as a foundational model for medical assistance systems, c
|
|
90 |
|
91 |
Here’s how to load and use the model for generating medical responses in Thai:
|
92 |
|
|
|
|
|
|
|
|
|
93 |
```python
|
94 |
-
|
|
|
95 |
|
96 |
-
|
97 |
-
tokenizer = AutoTokenizer.from_pretrained("amornpan/openthaigpt-MedChatModelv11")
|
98 |
-
model = AutoModelForCausalLM.from_pretrained("amornpan/openthaigpt-MedChatModelv11")
|
99 |
|
100 |
-
|
101 |
-
input_text = "ใส่คำถามทางการแพทย์ที่นี่"
|
102 |
-
inputs = tokenizer(input_text, return_tensors="pt")
|
103 |
|
104 |
-
|
105 |
-
|
|
|
106 |
|
107 |
-
#
|
108 |
-
|
109 |
|
|
|
|
|
|
|
110 |
```
|
111 |
-
โปรดอธิบายลักษณะช่องปากที่เป็นมะเร็งในระยะเริ่มต้น
|
112 |
-
|
113 |
-
ช่องปากมะเร็งในระยะเริ่มต้น อาจไม่มีอาการชัดเจน แต่ผู้คนบางกลุ่มอาจสังเกตเห็นอาการต่อไปนี้:
|
114 |
-
- มีการกัดหรือกระแทกบริเวณช่องปากโดยไม่มีสาเหตุ
|
115 |
-
- มีจุด ฝี เมล็ด หรือความไม่เท่าเทียมภายในช่องปากที่ไม่หายวื้อ
|
116 |
-
- ปวดหรือเจ็บบริเวณช่องปาก
|
117 |
-
- เปลี่ยนแปลงสีของเนื้อเยื่อในช่องปาก (อาจเป็นสีขาว หรือ黑马)
|
118 |
-
- มีตุ่มที่ไม่หาย ภายในช่องปาก
|
119 |
-
- มีความลำบากในการกิน มี
|
120 |
-
|
121 |
-
### More Information
|
122 |
-
```amornpan@gmail.com```
|
|
|
90 |
|
91 |
Here’s how to load and use the model for generating medical responses in Thai:
|
92 |
|
93 |
+
## 1. Install the Required Packages
|
94 |
+
|
95 |
+
First, ensure you have installed the required libraries by running:
|
96 |
+
|
97 |
```python
|
98 |
+
pip install torch transformers bitsandbytes
|
99 |
+
```
|
100 |
|
101 |
+
## 2. Load the Model and Tokenizer
|
|
|
|
|
102 |
|
103 |
+
You can load the model and tokenizer directly from Hugging Face using the following code:
|
|
|
|
|
104 |
|
105 |
+
```python
|
106 |
+
import torch
|
107 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
108 |
|
109 |
+
# Define the model path
|
110 |
+
model_path = 'amornpan/openthaigpt-MedChatModelv11'
|
111 |
|
112 |
+
# Load the tokenizer and model
|
113 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
114 |
+
tokenizer.pad_token = tokenizer.eos_token
|
115 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|