Skip to content

Commit

Permalink
Merge pull request #13 from Wauplin/add-hf-hub-support
Browse files Browse the repository at this point in the history
Add 馃 hub support
  • Loading branch information
monk1337 committed Feb 8, 2023
2 parents bc94ca6 + 1f7893d commit f99c503
Show file tree
Hide file tree
Showing 9 changed files with 748 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ dmypy.json

# Pyre type checker
.pyre/

.vscode
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sentence = "The patient is a 93-year-old female with a medical
of severe nausea and vomiting and urinary tract
infection"

model = OpenAI(api_key)
model = OpenAI(api_key) # or `HubModel()` for Huggingface-based inference
nlp_prompter = Prompter(model)


Expand Down Expand Up @@ -91,9 +91,10 @@ result = nlp_prompter.fit('ner.jinja',
<ul>
<li> Perform NLP tasks (such as NER and classification) in just 2 lines of code, with no training data required</li>
<li> Easily add one shot, two shot, or few shot examples to the prompt</li>
<li> Handling out-of-bounds prediction from LLMS (GPT, t5, etc.)
<li> Handling out-of-bounds prediction from LLMS (GPT, t5, etc.)</li>
<li> Output always provided as a Python object (e.g. list, dictionary) for easy parsing and filtering. This is a major advantage over LLMs generated output, whose unstructured and raw output makes it difficult to use in business or other applications.</li>
<li> Custom examples and samples can be easily added to the prompt</li>
<li> 馃 Run inference on any model stored on the Huggingface Hub (see <a href="https://github.com/promptslab/Promptify/blob/main/examples/huggingface.ipynb">notebook guide</a>).</li>
<li> Optimized prompts to reduce OpenAI token costs (coming soon)</li>
</ul>

Expand Down
8 changes: 1 addition & 7 deletions examples/data/binary.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,14 @@
"score": "",
"complexity": ""
},
{
"text": "i have been with petronas for years i feel that petronas has performed well and made a huge profit",
"labels": "negative",
"score": "",
"complexity": ""
},
{
"text": "I've read many post on here saying Israel gives training to US law enforcement .",
"labels": "positive",
"score": "",
"complexity": ""
},
{
"review": "And the sad thing is the white students at those schools will act like that too .",
"text": "And the sad thing is the white students at those schools will act like that too .",
"labels": "negative",
"score": "",
"complexity": ""
Expand Down
Loading

0 comments on commit f99c503

Please sign in to comment.