Skip to content

Commit

Permalink
adding the model
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramyrahmeni committed Jun 7, 2024
1 parent 9397193 commit bae602e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def ask(query, model, embedding_model, embeddings, pages_and_chunks, tokenizer,
print(f"Context items: {context_items}")

# Format the prompt with context items
print("Formatting the prompt")
'''print("Formatting the prompt")
prompt = prompt_formatter(query=query, context_items=context_items, tokenizer=tokenizer)
print(f"Prompt: {prompt}")
Expand Down Expand Up @@ -223,7 +223,7 @@ def ask(query, model, embedding_model, embeddings, pages_and_chunks, tokenizer,
return output_text
print("Returning answer with context items")
return output_text, context_items
return output_text, context_items'''


with st.sidebar:
Expand Down Expand Up @@ -295,12 +295,12 @@ def main():
)
print(model)
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct",token='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')
answer, context_items =ask(query,model,embedding_model,embeddings,pages_and_chunks,tokenizer,
ask(query,model,embedding_model,embeddings,pages_and_chunks,tokenizer,
temperature=0.7,
max_new_tokens=512,
format_answer_text=True,
return_answer_only=True)
st.text(answer)
#st.text(answer)

if __name__ == "__main__":
main()

0 comments on commit bae602e

Please sign in to comment.