-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a699b8
commit 2b3d55c
Showing
3 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
datasets | ||
transformers | ||
evaluate | ||
torch | ||
torch | ||
gradio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline | ||
import gradio as gr | ||
|
||
|
||
def load_model() -> 'AutoModelForSequenceClassification': | ||
""" Load Endian Classifier Model """ | ||
model_name = "ryfye181/distilbert_endian_classifier" | ||
return AutoModelForSequenceClassification.from_pretrained(model_name) | ||
|
||
def load_tokenizer() -> 'AutoTokenizer': | ||
""" Load Tokenizer """ | ||
model_name = "ryfye181/distilbert_endian_classifier" | ||
return AutoTokenizer.from_pretrained(model_name) | ||
|
||
if __name__ == '__main__': | ||
|
||
pipe = pipeline("text-classification", model=load_model(), tokenizer=load_tokenizer()) | ||
|
||
demo = gr.Interface().from_pipeline(pipe) | ||
demo.launch() |
This file was deleted.
Oops, something went wrong.