File size: 2,087 Bytes
45ed10f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec68db4
 
45ed10f
 
 
 
 
 
8dfdbdc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45ed10f
8dfdbdc
45ed10f
8dfdbdc
 
 
 
 
 
 
 
 
 
 
 
45ed10f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
tags:
- autotrain
- text-generation-inference
- text-generation
- peft
library_name: transformers
widget:
  - messages:
      - role: user
        content: What is your favorite condiment?
license: other
---

# Model Trained Using AutoTrain

This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).

Dataset used: tatsu-lab/alpaca

# Usage

```python

from transformers import AutoModelForCausalLM, AutoTokenizer

model_path = "kr-manish/Mistral-7B-autotrain-finetune-QA-vx"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path)

input_text = "What is the scientific name of the honey bee?"
# Tokenize input text
input_ids = tokenizer.encode(input_text, return_tensors="pt")

# Generate output text
output = model.generate(input_ids, max_length=100, num_return_sequences=1, do_sample=True)

# Decode and print output
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)

#Apis mellifera.
```

# Usage

```python

from transformers import AutoModelForCausalLM, AutoTokenizer

model_path = "kr-manish/Mistral-7B-autotrain-finetune-QA-vx"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path)

# Generate response
input_text = "Give three tips for staying healthy."
input_ids = tokenizer.encode(input_text, return_tensors="pt")
output = model.generate(input_ids, max_new_tokens = 200)
predicted_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(predicted_text)

#Give three tips for staying healthy. [/INST] 1. Eat a balanced diet: Make sure to include plenty of fruits, vegetables, lean proteins, and whole grains in your diet. Avoid processed foods and sugary drinks. 
#2. Exercise regularly: Aim for at least 30 minutes of moderate exercise every day, such as walking, cycling, or swimming. 
#3. Get enough sleep: Aim for 7-9 hours of quality sleep each night. Make sure to create a relaxing bedtime routine and stick to a regular sleep schedule. 
```