Views
No views yet
How can I cope with the stress and anxiety I've been experiencing lately?
- Talk to friends and family to get support.
- Do things you enjoy, such as sports, hobbies, or volunteering.
- Learn relaxation techniques for when you are stressed.
- Take short walks or get outside as often as you can to get fresh air.
I've been struggling with insomnia. What are some strategies to improve my sleep quality?
Learn about sleep hygiene. You can read about this topic at the Sleep Education and Therapy Page. Sleep hygiene can help you
- get the right amount of sleep at the right time
- stay relaxed and comfortable throughout the night
- fall asleep and stay asleep quickly
- remember to call your doctor if you suddenly feel better and you have a fever
- know when your next doctor visit is
- don't take naps at night or during the day if you take medication that affects your sleep
- don't drink caffeine or alcohol before you go to sleep or if you feel tired the next day
- don't smoke
- stop using caffeine or alcohol, or drink decaffeinated coffee
I have a chronic illness, and it's impacting my emotional well-being. How can I manage the emotional toll it's taking on me?
Think about how often you experience feelings such as sadness, worry, anger, or guilt. For example, do you feel frustrated or embarrassed when you cannot make others happy? Do you experience frequent feelings of sadness, despair, and anger? If so, take time to talk to a health professional about how to develop a better understanding of how and why you feel these emotions. Talk to a mental health professional about how to change destructive thinking patterns, Virgin Island Blueprints for Healthy Living guides for both men and women. A group session with other members of your support network may also help.
what are the preventive measures of diabetes?
Get physical activity. Make changes in your lifestyle such as a eating a healthly diet, quitting smoke, and getting regular physical activity. Getting physical activity will help you lose weight and keep your blood glucose levels down. Talk with your health care provider before you start new exercise program. You may need to adjust your medication or try a different medicine.
| Hyperparameter | Value |
|---|---|
| \(n_{parameters}\) | 6053381344 |
| \(n_{layers}\) | 28* |
| \(d_{model}\) | 4096 |
| \(d_{ff}\) | 16384 |
| \(n_{heads}\) | 16 |
| \(d_{head}\) | 256 |
| \(n_{ctx}\) | 2048 |
| \(n_{vocab}\) | 50257/50400† (same tokenizer as GPT-2/3) |
| Positional Encoding | Rotary Position Embedding (RoPE) |
| RoPE Dimensions | 64 |
bitsandbytes quantization config was used during training:!pip install -q -U huggingface_hub peft transformers torch accelerate bitsandbytes1from peft import PeftModel, PeftConfig
2from transformers import AutoModelForCausalLM, AutoTokenizer1INTRO = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
2INSTRUCTION_FORMAT = (
3 """{intro} ### Instruction: {instruction} ### Input: {input} ### Response: """
4)
5
6def load_model_tokenizer_for_generate(pretrained_model_name_or_path: str):
7 tokenizer = AutoTokenizer.from_pretrained(
8 pretrained_model_name_or_path, padding_side="left"
9 )
10 model = AutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path)
11 return model, tokenizer1def generate_response(
2 instruction: str,
3 input_text: str,
4 *,
5 model,
6 tokenizer,
7 do_sample: bool = True,
8 max_new_tokens: int = 500,
9 top_p: float = 0.92,
10 top_k: int = 0,
11 **kwargs,
12) -> str:
13 input_ids = tokenizer(
14 INSTRUCTION_FORMAT.format(
15 intro=INTRO, instruction=instruction, input=input_text
16 ),
17 return_tensors="pt",
18 ).input_ids
19 gen_tokens = model.generate(
20 input_ids=input_ids,
21 pad_token_id=tokenizer.pad_token_id,
22 do_sample=do_sample,
23 max_new_tokens=max_new_tokens,
24 top_p=top_p,
25 top_k=top_k,
26 **kwargs,
27 )
28 decoded = tokenizer.batch_decode(gen_tokens)[0]
29
30 # The response appears after "### Response:". The model has been trained to append "### End" at the end.
31 m = re.search(r"#+\s*Response:\s*(.+?)#+\s*End", decoded, flags=re.DOTALL)
32
33 response = None
34 if m:
35 response = m.group(1).strip()
36 else:
37 # The model might not generate the "### End" sequence before reaching the max tokens. In this case, return
38 # everything after "### Response:".
39 m = re.search(r"#+\s*Response:\s*(.+)", decoded, flags=re.DOTALL)
40 if m:
41 response = m.group(1).strip()
42 else:
43 print(f"Failed to find response in:\n{decoded}")
44
45 return response1if __name__ == "__main__":
2 base_model = "EleutherAI/gpt-j-6B"
3 peft_model_id = "ghimiresunil/MedDoctor"
4 config = PeftConfig.from_pretrained(peft_model_id)
5 model = AutoModelForCausalLM.from_pretrained(base_model, return_dict=True)
6 trained_model = PeftModel.from_pretrained(model, peft_model_id)
7
8 tokenizer = AutoTokenizer.from_pretrained(base_model)
9
10 print("Welcome to the response generation program!")
11 while True:
12 instruction = "If you are a doctor, please answer the medical questions based on user's query"
13 input_text = input("Enter the input text: ")
14 response = generate_response(
15 instruction=instruction,
16 input_text=input_text,
17 model=trained_model,
18 tokenizer=tokenizer,
19 )
20 print('*' * 100)
21 print("Generated Response:")
22 print(response)
23 print('*' * 100)
24
25 continue_generation = input("Do you want to continue (yes/no)? ").lower()
26 if continue_generation != "yes":
27 print("Exiting the response generation program.")
28 break1@misc{gpt-j,
2 author = {Wang, Ben and Komatsuzaki, Aran},
3 title = {{GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model}},
4 howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
5 year = 2021,
6 month = May
7}1@misc{mesh-transformer-jax,
2 author = {Wang, Ben},
3 title = {{Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX}},
4 howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
5 year = 2021,
6 month = May
7}