final app without pipeline
Browse files
app.py
CHANGED
@@ -2,11 +2,9 @@ import requests, json
|
|
2 |
|
3 |
#Summarization endpoint
|
4 |
def get_completion(inputs, parameters=None,ENDPOINT_URL='https://api-inference.huggingface.co/models/DunnBC22/flan-t5-base-text_summarization_data'):
|
5 |
-
hf_api_key = "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" # Read API key from environment variable
|
6 |
|
7 |
|
8 |
headers = {
|
9 |
-
#"Authorization": f"Bearer {hf_api_key}",
|
10 |
"Content-Type": "application/json"
|
11 |
}
|
12 |
data = { "inputs": inputs }
|
|
|
2 |
|
3 |
#Summarization endpoint
|
4 |
def get_completion(inputs, parameters=None,ENDPOINT_URL='https://api-inference.huggingface.co/models/DunnBC22/flan-t5-base-text_summarization_data'):
|
|
|
5 |
|
6 |
|
7 |
headers = {
|
|
|
8 |
"Content-Type": "application/json"
|
9 |
}
|
10 |
data = { "inputs": inputs }
|