huedaya commited on
Commit
887a39c
·
verified ·
1 Parent(s): 3181aa3

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -2,7 +2,7 @@ from fastapi import FastAPI, HTTPException
2
  from fastapi.middleware.cors import CORSMiddleware
3
  from pydantic import BaseModel
4
  from huggingface_hub import InferenceClient
5
- import streamlit as st
6
 
7
  app = FastAPI()
8
 
@@ -55,7 +55,7 @@ def generate(item: Item):
55
  @app.post("/generate/")
56
  async def generate_text(item: Item):
57
  # reject if key not the same
58
- apiKey = st.secrets["API_KEY"]
59
  # if apiKey != key:
60
  # return jsonify({
61
  # "image_url": image_url,
 
2
  from fastapi.middleware.cors import CORSMiddleware
3
  from pydantic import BaseModel
4
  from huggingface_hub import InferenceClient
5
+ import os
6
 
7
  app = FastAPI()
8
 
 
55
  @app.post("/generate/")
56
  async def generate_text(item: Item):
57
  # reject if key not the same
58
+ apiKey = os.environ.get("API_KEY")
59
  # if apiKey != key:
60
  # return jsonify({
61
  # "image_url": image_url,