ManojINaik commited on
Commit
f657e3a
·
verified ·
1 Parent(s): 699be26

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -3
main.py CHANGED
@@ -1,6 +1,6 @@
1
  from fastapi import FastAPI, HTTPException
2
  from pydantic import BaseModel
3
- from huggingface_hub import InferenceClient, BadRequestError
4
 
5
  app = FastAPI()
6
 
@@ -51,8 +51,6 @@ def generate(item: Item):
51
  output = "".join([response.token.text for response in stream])
52
  return output
53
 
54
- except BadRequestError as e:
55
- raise HTTPException(status_code=400, detail=f"Bad request: {str(e)}")
56
  except Exception as e:
57
  raise HTTPException(status_code=500, detail=f"Internal error: {str(e)}")
58
 
 
1
  from fastapi import FastAPI, HTTPException
2
  from pydantic import BaseModel
3
+ from huggingface_hub import InferenceClient
4
 
5
  app = FastAPI()
6
 
 
51
  output = "".join([response.token.text for response in stream])
52
  return output
53
 
 
 
54
  except Exception as e:
55
  raise HTTPException(status_code=500, detail=f"Internal error: {str(e)}")
56