liutiedong / goat Goto Github PK
View Code? Open in Web Editor NEWa Fine-tuned LLaMA that is Good at Arithmetic Tasks
a Fine-tuned LLaMA that is Good at Arithmetic Tasks
As per title.
I think it's still a long way off, only support integers and single step calculations
How to calculate the accuracy of division while the gt is not "quotient R remainder" format in Big-Bench?
@liutiedong what is the right way to prompt the model.
say , i have the following code , how would you edit it to fix the prompting :
def generate_prompt_with_history(text,history,tokenizer,max_length=2048):
prompt = "The following is a conversation between a human and an AI assistant named Goat. The human and the AI assistant take turns chatting. Human statements start with [|Human|] and AI assistant statements start with [|AI|]. The AI assistant always provides responses in as much detail as possible, and in Markdown format. The AI assistant always declines to engage with topics, questions and instructions related to unethical, controversial, or sensitive issues. Complete the transcript in exactly that format.\n[|Human|]Hello!\n[|AI|]Hi!"
history = ["\n[|Human|]{}\n[|AI|]{}".format(x[0],x[1]) for x in history]
history.append("\n[|Human|]{}\n[|AI|]".format(text))
history_text = ""
flag = False
for x in history[::-1]:
if tokenizer(prompt+history_text+x, return_tensors="pt")['input_ids'].size(-1) <= max_length:
history_text = x + history_text
flag = True
else:
break
if flag:
return prompt+history_text,tokenizer(prompt+history_text, return_tensors="pt")
else:
return None
def is_stop_word_or_prefix(s: str, stop_words: list) -> bool:
for stop_word in stop_words:
if s.endswith(stop_word):
return True
for i in range(1, len(stop_word)):
if s.endswith(stop_word[:i]):
return True
return False
With the above code I'm getting hallucinations , can you suggest a fix.
Hi!
Thanks a lot for releasing this code and data.
I saw that the data on HF is under Apache 2.0 license but I couldn't see a license file for the code.
Could you add one?
Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.