Pravincoder commited on
Commit
ded51bf
1 Parent(s): f152b82

Update README.md

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