We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc8d112 commit 5e59929Copy full SHA for 5e59929
1 file changed
llm/transformers-pipeline.py
@@ -0,0 +1,12 @@
1
+#!/usr/bin/env python3
2
+
3
+from transformers import pipeline
4
5
+model = pipeline("text-generation")
6
7
8
+def predict(prompt):
9
+ completion = model(prompt)[0]["generated_text"]
10
+ return completion
11
12
+print(predict("My favorite programming language is"))
0 commit comments