Views
No views yet

1base_model: mlabonne/NeuralDaredevil-7B
2gate_mode: hidden
3experts:
4 - source_model: mlabonne/NeuralDaredevil-7B
5 positive_prompts:
6 - "hello"
7 - "help"
8 - "question"
9 - "explain"
10 - "information"
11 - source_model: BioMistral/BioMistral-7B
12 positive_prompts:
13 - "medical"
14 - "health"
15 - "biomedical"
16 - "clinical"
17 - "anatomy"
18 - source_model: mistralai/Mathstral-7B-v0.1
19 positive_prompts:
20 - "math"
21 - "calculation"
22 - "equation"
23 - "geometry"
24 - "algebra"
25 - source_model: FPHam/Writing_Partner_Mistral_7B
26 positive_prompts:
27 - "writing"
28 - "creative process"
29 - "story structure"
30 - "character development"
31 - "plot"1from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
2
3# Load the tokenizer and model
4tokenizer = AutoTokenizer.from_pretrained("AdamLucek/EduMixtral-4x7B")
5model = AutoModelForCausalLM.from_pretrained(
6 "AdamLucek/EduMixtral-4x7B",
7 device_map="cuda",
8 quantization_config=BitsAndBytesConfig(load_in_8bit=True)
9)
10
11# Prepare the input text
12input_text = "Math problem: Xiaoli reads a 240-page story book. She reads (1/8) of the whole book on the first day and (1/5) of the whole book on the second day. How many pages did she read in total in two days?"
13input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
14
15# Generate the output with specified parameters
16outputs = model.generate(
17 **input_ids,
18 max_new_tokens=256,
19 num_return_sequences=1
20)
21
22# Decode and print the generated text
23print(tokenizer.decode(outputs[0], skip_special_tokens=True))Solution:
To find the total number of pages Xiaoli read in two days, we need to add the number of pages she read on the first day and the second day.
On the first day, Xiaoli read 1/8 of the book. Since the book has 240 pages, the number of pages she read on the first day is:
[ \frac{1}{8} \times 240 = 30 \text{ pages} ]
On the second day, Xiaoli read 1/5 of the book. The number of pages she read on the second day is:
[ \frac{1}{5} \times 240 = 48 \text{ pages} ]
To find the total number of pages she read in two days, we add the pages she read on the first day and the second day:
[ 30 \text{ pages} + 48 \text{ pages} = 78 \text{ pages} ]
Therefore, Xiaoli read a total of 78 pages in two days.
Final answer: Xiaoli read 78 pages in total