Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -2,7 +2,25 @@ import gradio as gr
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
client = InferenceClient(model='mistralai/Mistral-7B-Instruct-v0.2')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
#from langchain import HuggingFaceHub
|
7 |
#import os
|
8 |
#from langchain.vectorstores import Chroma
|
@@ -86,23 +104,3 @@ demo = gr.ChatInterface(
|
|
86 |
|
87 |
if __name__ == "__main__":
|
88 |
demo.launch(share=True)
|
89 |
-
|
90 |
-
# from fastapi import FastAPI
|
91 |
-
# from fastapi.staticfiles import StaticFiles
|
92 |
-
# from fastapi.responses import FileResponse
|
93 |
-
# from transformers import pipeline
|
94 |
-
|
95 |
-
# app = FastAPI()
|
96 |
-
|
97 |
-
# pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
98 |
-
|
99 |
-
# @app.get("/infer_t5")
|
100 |
-
# def t5(input):
|
101 |
-
# output = pipe_flan(input)
|
102 |
-
# return {"output": output[0]["generated_text"]}
|
103 |
-
|
104 |
-
# app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
105 |
-
|
106 |
-
# @app.get("/")
|
107 |
-
# def index() -> FileResponse:
|
108 |
-
# return FileResponse(path="/app/static/index.html", media_type="text/html")
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
client = InferenceClient(model='mistralai/Mistral-7B-Instruct-v0.2')
|
5 |
+
# from fastapi import FastAPI
|
6 |
+
# from fastapi.staticfiles import StaticFiles
|
7 |
+
# from fastapi.responses import FileResponse
|
8 |
+
# from transformers import pipeline
|
9 |
+
|
10 |
+
# app = FastAPI()
|
11 |
+
|
12 |
+
# pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
13 |
|
14 |
+
# @app.get("/infer_t5")
|
15 |
+
# def t5(input):
|
16 |
+
# output = pipe_flan(input)
|
17 |
+
# return {"output": output[0]["generated_text"]}
|
18 |
+
|
19 |
+
# app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
20 |
+
|
21 |
+
# @app.get("/")
|
22 |
+
# def index() -> FileResponse:
|
23 |
+
# return FileResponse(path="/app/static/index.html", media_type="text/html")
|
24 |
#from langchain import HuggingFaceHub
|
25 |
#import os
|
26 |
#from langchain.vectorstores import Chroma
|
|
|
104 |
|
105 |
if __name__ == "__main__":
|
106 |
demo.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|