Update README.md
Browse files
README.md
CHANGED
@@ -16,30 +16,31 @@ license: other
|
|
16 |
|
17 |
This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
|
18 |
|
|
|
|
|
|
|
|
|
19 |
# Usage
|
20 |
|
21 |
```python
|
22 |
|
23 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
24 |
|
25 |
-
model_path = "
|
26 |
-
|
27 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
28 |
-
model = AutoModelForCausalLM.from_pretrained(
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
# Model response: "Hello! How can I assist you today?"
|
44 |
-
print(response)
|
45 |
```
|
|
|
16 |
|
17 |
This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
|
18 |
|
19 |
+
Dataset used: codeparrot/xlcost-text-to-code
|
20 |
+
|
21 |
+
github: https://github.com/manishzed/LLM-Fine-tune
|
22 |
+
|
23 |
# Usage
|
24 |
|
25 |
```python
|
26 |
|
27 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
28 |
|
29 |
+
model_path = "kr-manish/Mistral-7B-autotrain-text-python-vf1"
|
|
|
30 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
31 |
+
model = AutoModelForCausalLM.from_pretrained(model_path)
|
32 |
+
|
33 |
+
#input_text = "Maximum Prefix Sum possible by merging two given arrays | Python3 implementation of the above approach ; Stores the maximum prefix sum of the array A [ ] ; Traverse the array A [ ] ; Stores the maximum prefix sum of the array B [ ] ; Traverse the array B [ ] ;"
|
34 |
+
input_text ="Program to convert Centimeters to Pixels | Function to convert centimeters to pixels ; Driver Code"
|
35 |
+
# Tokenize input text
|
36 |
+
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
37 |
+
|
38 |
+
# Generate output text
|
39 |
+
output = model.generate(input_ids, max_length=1024, num_return_sequences=1, do_sample=True)
|
40 |
+
|
41 |
+
# Decode and print output
|
42 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
43 |
+
print(generated_text)
|
44 |
+
|
45 |
+
#Program to convert Centimeters to Pixels | Function to convert centimeters to pixels ; Driver Code [/INST] def cmToPixels ( cm ) : NEW_LINE INDENT return ( ( cm * 100 ) / 17 ) NEW_LINE DEDENT cm = 105.25 NEW_LINE print ( round ( cmToPixels ( cm ) , 3 ) ) NEW_LINE
|
|
|
|
|
46 |
```
|