nbroad HF staff commited on
Commit
8332365
1 Parent(s): 1f6a3f8

proper example

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -60,10 +60,10 @@ You can use the model for inference tasks like question-answering and medical di
60
 
61
  from transformers import pipeline
62
 
63
- qa_pipeline = pipeline("question-answering", model="medalpaca/medalpaca-13b", tokenizer="medalpaca/medalpaca-13b")
64
  question = "What are the symptoms of diabetes?"
65
  context = "Diabetes is a metabolic disease that causes high blood sugar. The symptoms include increased thirst, frequent urination, and unexplained weight loss."
66
- answer = qa_pipeline({"question": question, "context": context})
67
  print(answer)
68
  ```
69
 
 
60
 
61
  from transformers import pipeline
62
 
63
+ pl = pipeline("text-generation", model="medalpaca/medalpaca-13b", tokenizer="medalpaca/medalpaca-13b")
64
  question = "What are the symptoms of diabetes?"
65
  context = "Diabetes is a metabolic disease that causes high blood sugar. The symptoms include increased thirst, frequent urination, and unexplained weight loss."
66
+ answer = pl(f"Context: {context}\n\nQuestion: {question}\n\nAnswer: ")
67
  print(answer)
68
  ```
69