zaursamedov1 commited on
Commit
64d1dd6
1 Parent(s): e7d17d6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -19
README.md CHANGED
@@ -1,29 +1,37 @@
1
  ---
2
- {}
3
- ---
4
- ---
5
  license: apache-2.0
 
6
 
 
7
 
 
8
 
9
- ## 🧩 Simple Use Case
10
 
11
- ### define the function
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  def get_completion(input):
14
- system = "Think step by step and solve the problem in a friendly way."
15
- prompt = f"#### System: {system}
16
- #### User:
17
- {input}
18
-
19
- #### Response from My merged test model:"
20
- print(prompt)
21
- fixtral_prompt = test_slerp_pipeline(prompt,
22
- max_new_tokens=500
23
- )
24
- return fixtral_prompt[0]["generated_text"]
25
-
26
- # let's prompt
27
  prompt = "problem"
 
28
 
29
- print(get_completion(prompt))
 
1
  ---
 
 
 
2
  license: apache-2.0
3
+ ---
4
 
5
+ ## 🧩 Simple Use Case
6
 
7
+ This section demonstrates a simple use case of how to interact with our model to solve problems in a step-by-step, friendly manner.
8
 
9
+ ### Define the Function
10
 
11
+ We define a function `get_completion` which takes user input, combines it with a predefined system prompt, and then sends this combined prompt to our model. The model's response is then printed out.
12
 
13
+ Here's how the function is implemented:
14
+
15
+ ```python
16
+ import torch
17
+ from transformers import pipeline
18
+ import os
19
+
20
+ # Load model
21
+ test_pipeline = pipeline(model="zaursamedov1/FIxtral",
22
+ torch_dtype=torch.bfloat16,
23
+ trust_remote_code=True,
24
+ device_map="auto")
25
+
26
+ ### Define the function
27
  def get_completion(input):
28
+ system = "Think step by step and solve the problem in a friendly way."
29
+ prompt = f"#### System: {system}\\n#### User: \\n{input}\\n\\n#### Response from FIxtral model:"
30
+ print(prompt)
31
+ fixtral_prompt = test_pipeline(prompt, max_new_tokens=500)
32
+ return fixtral_prompt[0]["generated_text"]
33
+
34
+ # Let's prompt
 
 
 
 
 
 
35
  prompt = "problem"
36
+ print(get_completion(prompt))
37