Pravincoder
commited on
Commit
•
59a0c5e
1
Parent(s):
8c40131
Update README.md
Browse files
README.md
CHANGED
@@ -2,8 +2,84 @@
|
|
2 |
tags:
|
3 |
- autotrain
|
4 |
- text-generation
|
|
|
|
|
5 |
widget:
|
6 |
-
- text:
|
|
|
|
|
|
|
|
|
7 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Model Trained Using AutoTrain
|
|
|
2 |
tags:
|
3 |
- autotrain
|
4 |
- text-generation
|
5 |
+
- health
|
6 |
+
- medical
|
7 |
widget:
|
8 |
+
- text: 'I love AutoTrain because '
|
9 |
+
license: mit
|
10 |
+
language:
|
11 |
+
- en
|
12 |
+
library_name: peft
|
13 |
---
|
14 |
+
---
|
15 |
+
|
16 |
+
|
17 |
+
### Base Model Description
|
18 |
+
|
19 |
+
The Pythia 70M model is a transformer-based language model developed by EleutherAI.
|
20 |
+
It is part of the Pythia series, known for its high performance in natural language understanding and generation tasks.
|
21 |
+
With 70 million parameters, it is designed to handle a wide range of NLP applications, offering a balance between computational efficiency and model capability.
|
22 |
+
|
23 |
+
|
24 |
+
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
25 |
+
|
26 |
+
- **Developed by:** Pravin Maurya
|
27 |
+
- **Model type:** LoRa fine-tuned transformer model
|
28 |
+
- **Language(s) (NLP):** English
|
29 |
+
- **License:** MIT
|
30 |
+
- **Finetuned from model:** EleutherAI/pythia-70m
|
31 |
+
|
32 |
+
### Model Sources [optional]
|
33 |
+
|
34 |
+
<!-- Provide the basic links for the model. -->
|
35 |
+
|
36 |
+
- **Colab Link:** [Click me🔗](https://colab.research.google.com/drive/1tyogv7jtc8a4h23pEIlJW2vBgWTTzy3e#scrollTo=b6fQzRl2faSn)
|
37 |
+
|
38 |
+
## Uses
|
39 |
+
|
40 |
+
Downstream uses are model can be fine-tuned further for specific applications like medical AI assistants, legal document generation, and other domain-specific NLP tasks.
|
41 |
+
|
42 |
+
## How to Get Started with the Model
|
43 |
+
|
44 |
+
Use the code below to get started with the model.
|
45 |
+
|
46 |
+
```python
|
47 |
+
import torch
|
48 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
49 |
+
|
50 |
+
model = AutoModelForCausalLM.from_pretrained("Pravincoder/pythia-legal-llm-v4 ")
|
51 |
+
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/pythia-70m")
|
52 |
+
|
53 |
+
def inference(text, model, tokenizer, max_input_tokens=1000, max_output_tokens=200):
|
54 |
+
input_ids = tokenizer.encode(text, return_tensors="pt", truncation=True, max_length=max_input_tokens)
|
55 |
+
device = model.device
|
56 |
+
generated_tokens_with_prompt = model.generate(input_ids=input_ids.to(device), max_length=max_output_tokens)
|
57 |
+
generated_text_with_prompt = tokenizer.batch_decode(generated_tokens_with_prompt, skip_special_tokens=True)
|
58 |
+
generated_text_answer = generated_text_with_prompt[0][len(text):]
|
59 |
+
return generated_text_answer
|
60 |
+
|
61 |
+
system_message = "Welcome to the medical AI assistant."
|
62 |
+
user_message = "What are the symptoms of influenza?"
|
63 |
+
generated_response = inference(system_message, user_message, model, tokenizer)
|
64 |
+
print("Generated Response:", generated_response)
|
65 |
+
```
|
66 |
+
|
67 |
+
## Training Data
|
68 |
+
The model was fine-tuned using data relevant to the medical Chat data. for more info [click me🔗](https://huggingface.co/datasets/keivalya/MedQuad-MedicalQnADataset)
|
69 |
+
|
70 |
+
|
71 |
+
### Training Procedure
|
72 |
+
|
73 |
+
Data preprocessing involved tokenization and formatting suitable for the transformer model.
|
74 |
+
|
75 |
+
#### Training Hyperparameters
|
76 |
+
-Training regime: Mixed precision (fp16)
|
77 |
+
|
78 |
+
## Hardware
|
79 |
+
- **Hardware Type:** T4 Google Colab GPU
|
80 |
+
- **Hours used:** 1.30-2 hr
|
81 |
+
|
82 |
+
## Model Card Contact
|
83 |
+
Email :- PravinCoder@gmail.com
|
84 |
|
85 |
# Model Trained Using AutoTrain
|