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
Hi,
Firstly thanks for this cool repo. I am trying to build a question and answer app using GPT3. How do I save a document file or feed the example with say 500 words text based on which users will question and the API will search the file or given text and provide the answer. Endpoint for is given in the GPT3 example but I am finding it tough to integrate it with this repo example. Any help is appreciated. Below the given code:
doc_list=["sample text to be searched."]
response = openai.Answer.create(
search_model="davinci",
model="curie",
question="What is sample text",
documents=doc_list,
examples_context="In 2017, U.S. life expectancy was 78.6 years.",
examples=[["What is human life expectancy in the United States?","78 years."]],
max_tokens=10,
stop=["\n", "<|endoftext|>"],
)
print(response)
Thanks,
Raji
The text was updated successfully, but these errors were encountered:
Hi, I tried modifying the gpt.py file to add this endpoint
def submit_request(self, prompt):
"""Calls the OpenAI API with the specified parameters."""
response = openai.Answer.create(
search_model="davinci",
model="curie",
question=self.craft_query(prompt),
document=doc_list,
examples_context="In 2017, U.S. life expectancy was 78.6 years.",
examples=[["What is human life expectancy in the United States?","78 years."]],
max_tokens=self.get_max_tokens(),
temperature=self.get_temperature(),
stop=["\n", "<|endoftext|>"])
return response
in my example.py file I have added the doc_list which is a list of text.
when i execute the example.py file i am getting error as AttributeError: module 'openai' has no attribute 'Answer'
Hi,
Firstly thanks for this cool repo. I am trying to build a question and answer app using GPT3. How do I save a document file or feed the example with say 500 words text based on which users will question and the API will search the file or given text and provide the answer. Endpoint for is given in the GPT3 example but I am finding it tough to integrate it with this repo example. Any help is appreciated. Below the given code:
doc_list=["sample text to be searched."]
response = openai.Answer.create(
search_model="davinci",
model="curie",
question="What is sample text",
documents=doc_list,
examples_context="In 2017, U.S. life expectancy was 78.6 years.",
examples=[["What is human life expectancy in the United States?","78 years."]],
max_tokens=10,
stop=["\n", "<|endoftext|>"],
)
print(response)
Thanks,
Raji
The text was updated successfully, but these errors were encountered: