-
Notifications
You must be signed in to change notification settings - Fork 0
/
gg.py
30 lines (22 loc) · 795 Bytes
/
gg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import streamlit as st
from transformers import pipeline
from transformers import AutoModelForSequenceClassification, AutoTokenizer, DistilBertForSequenceClassification
import torch
import emoji
import time
from PIL import Image
from pathlib import Path
import pandas as pd
import numpy as np
import requests
import requests
API_URL = "https://api-inference.huggingface.co/models/davidchiii/fine-trained-distilbert"
headers = {"Authorization": "Bearer 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"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
output = query({
"inputs": "I like you. I love you",
})
print(output)