You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made a cumulative prompt structure for doing conversation with LLaMA-2 using lit-llama repository such that it can remember context of previous prompts and their responses from the conversation. Here is a snippet of a conversation with LLaMA which had bizzare responses.
Loading model ...
Time to load model: 20.19 seconds.
Prompt:Name all the districts in the Indian state of Bihar.
LLaMA: There are 38 districts in the Indian state of Bihar. The districts are:
1. Aurangabad
2. Begusarai
3. Bhagalpur
4. Bhojpur
5. Buxar
6. Darbhanga
7. Gaya
8. Hajipur
9. Jamui
10. Khagaria
11. Kishanganj
12. Lakhisarai
13. Madhubani
14. Munger
15. Nalanda
16. Nawada
17. Patna
18. Purnia
19. Rohtas
20. Samastipur
21. Saran
22. Sheohar
23. Sitamarhi
24. Siwan
25. Supaul
26. Vaishali
27. West Champaran
28. East Champaran
29. Sitamarhi
30. Darbhanga
31. Khagaria
32. Begusarai
33. Purnia
34. Kishanganj
35. Aurangabad
36. Gaya
37. Lakhisarai
38. Nalanda
Time for inference: 8.09 sec total, 126.64 tokens/sec
Memory used: 14.12 GB
Prompt:Name all the ministers in the cabinet of prime minister of India
LLaMA: India has several hill stations, including:
1. Shimla - Himachal Pradesh
2. Darjeeling - West Bengal
3. Gangtok - Sikkim
4. Kodaikanal - Tamil Nadu
5. Ooty - Tamil Nadu
6. Kashmir - Jammu and Kash -
Time for inference: 18.84 sec total, 54.35 tokens/sec
Memory used: 14.23 GB
Prompt:
======================================================================================
One explaination for this could be somehow the response form previous prompt is getting printed here in the next prompt. Why is this happening?
Following is the conversation loop i used in the lora.py script in generate folder of the repo.
also i used custom function generate_conversation in perpare_alpaca.py script
def generate_conversation(example, conversation: str):
"""Custom function to generate a message to do conversation with the model by making it remember the previous prompts"""
if example["input"]:
conversation+=f"### Instruction:\n{example['instruction']}\n\n### Input:\n{example['input']}\n\n### Response:"
return (
#"Below is an instruction that describes a task, paired with an input that provides further context. "
#"Write a response that appropriately completes the request.\n\n"
conversation
)
conversation+=f"### Instruction:\n{example['instruction']}\n\n### Response:"
return (
#"Below is an instruction that describes a task. "
#"Write a response that appropriately completes the request.\n\n"
conversation
)
rest of the code is not touched in the repository, I am first doing fine-tuning of the LLaMA model then i am trying to do conversation. Please help!
The text was updated successfully, but these errors were encountered:
I have made a cumulative prompt structure for doing conversation with LLaMA-2 using lit-llama repository such that it can remember context of previous prompts and their responses from the conversation. Here is a snippet of a conversation with LLaMA which had bizzare responses.
======================================================================================
One explaination for this could be somehow the response form previous prompt is getting printed here in the next prompt. Why is this happening?
Following is the conversation loop i used in the lora.py script in generate folder of the repo.
also i used custom function
generate_conversation
in perpare_alpaca.py scriptrest of the code is not touched in the repository, I am first doing fine-tuning of the LLaMA model then i am trying to do conversation. Please help!
The text was updated successfully, but these errors were encountered: