vonshed commited on
Commit
72ef3a9
1 Parent(s): 08026af

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +6 -19
index.js CHANGED
@@ -1,20 +1,7 @@
1
- import { pipeline, env } from '@xenova/transformers';
2
 
3
- // You can remove this if you are running locally
4
- env.allowLocalModels = false;
5
-
6
- // Choose model to use
7
- let model = 'Xenova/distilbert-base-uncased-distilled-squad';
8
-
9
- // Specify question and context
10
- let question = 'Who was Jim Henson?'
11
- let context = 'Jim Henson was a nice puppet.'
12
-
13
- // Run pipeline
14
- let answerer = await pipeline('question-answering', model);
15
- let outputs = await answerer(question, context);
16
- console.log(outputs);
17
- // {
18
- // "answer": "a nice puppet",
19
- // "score": 0.5768911502526741
20
- // }
 
1
+ from transformers import pipeline
2
 
3
+ qa_model = pipeline("question-answering")
4
+ question = "Where do I live?"
5
+ context = "My name is Merve and I live in İstanbul."
6
+ x = qa_model(question = question, context = context)
7
+ console.log('qa_model',x)