Views
No views yet
1alpaca_prompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n### Input:\nContinue the fibonnaci sequence.\n\n### Output:"
2
3from unsloth import FastLanguageModel
4FastLanguageModel.for_inference(model) # Enable native 2x faster inference
5
6inputs = tokenizer([alpaca_prompt.format("Continue the fibonnaci sequence.", "1, 1, 2, 3, 5, 8", "")], return_tensors="pt").to("cuda")
7outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
8print(tokenizer.batch_decode(outputs))
9Output:
10['<s> Below is an instruction that describes a task. Write a response that appropriately completes the request.\n### Input:\nContinue the fibonnaci sequence.\n\n### Output:\n1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89</s>']
11
12**Test 2: Famous tall tower in Paris**
13alpaca_prompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n### Input:\nWhat is a famous tall tower in Paris?\n\n### Output:"
14
15from unsloth import FastLanguageModel
16FastLanguageModel.for_inference(model) # Enable native 2x faster inference
17
18inputs = tokenizer([alpaca_prompt.format("What is a famous tall tower in Paris?", "", "")], return_tensors="pt").to("cuda")
19from transformers import TextStreamer
20text_streamer = TextStreamer(tokenizer)
21_ = model.generate(**inputs, streamer=text_streamer, max_new_tokens=64)
22Output:
23Eiffel Tower, located in Paris, is a famous tall tower that stands at 320 meters (98 feet) tall. It was built in 189002 as a symbol of the city's modernization and progress, and it remains an iconic landmark to this
24For the first time, the AI answered both questions correctly, despite the response about the Eiffel Tower containing errors about the year and not finishing the response. I will continue refining the AI with the data-oss_instruct-decontaminated_python.jsonl dataset. This version of the dataset only contains Python code, and since I can only train on the free Colab GPU, I was forced to split the dataset into 10 parts and refine the AI for two epochs with each part (up to this point, we are on the fifth part of the dataset)... Thanks to the Unsloth team, without you, I wouldn't have even achieved any relevant training on an AI since I don't have a GPU!