Quardo commited on
Commit
899e654
1 Parent(s): a48c771

Updated space

Browse files
Files changed (2) hide show
  1. app.py +12 -2
  2. index.html +3 -4
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from starlette.responses import JSONResponse, FileResponse
2
  from gradio.data_classes import FileData, GradioModel
3
  from sse_starlette.sse import EventSourceResponse
4
  from typing import (List, Tuple, Optional)
@@ -585,7 +585,17 @@ app = FastAPI()
585
 
586
  @app.get("/declined")
587
  def test():
588
- return JSONResponse(content="ok, you can back to huggingface. I just didn't had any idea to how to handle decline soo you are redricted here.")
 
 
 
 
 
 
 
 
 
 
589
 
590
  @app.get("/api/v1/docs")
591
  def html():
 
1
+ from starlette.responses import JSONResponse, FileResponse, HTMLResponse
2
  from gradio.data_classes import FileData, GradioModel
3
  from sse_starlette.sse import EventSourceResponse
4
  from typing import (List, Tuple, Optional)
 
585
 
586
  @app.get("/declined")
587
  def test():
588
+ return HTMLResponse(content="""
589
+ <html>
590
+ <head>
591
+ <title>Declined</title>
592
+ </head>
593
+ <body>
594
+ <p>Ok, you can go back to Hugging Face. I just didn't have any idea how to handle decline so you are redirected here.</p><br/>
595
+ <a href="/">Go back</button>
596
+ </body>
597
+ </html>
598
+ """)
599
 
600
  @app.get("/api/v1/docs")
601
  def html():
index.html CHANGED
@@ -108,11 +108,10 @@
108
  <p>Here are some example codes to interact with the API:</p>
109
  <p><strong>Note:</strong> By using our API, you acknowledge and agree to the following terms regarding the data you provide:</p>
110
  <ul>
111
- <li>Data Collection: This application may collect data shared through the Gradio endpoint or the API endpoint.</li>
 
 
112
  <li>Privacy: Please avoid sharing any personal information.</li>
113
- <li>Data Retention and Removal: Data files are deleted every 30 days, and the API is restarted to ensure data clearance.</li>
114
- <li>Scope of Data Collected: The data collected includes model settings, chat history, and responses from the model. This applies only to 'chat' endpoints (Gradio and API) and excludes moderation checks.</li>
115
- <li>Data Usage: The collected data is periodically reviewed, and if any concerning activity is detected, the code is updated accordingly.</li>
116
  </ul>
117
  <p>By continuing to use our API, you explicitly consent to the collection, use, and potential sharing of your data as described above. If you disagree with our data collection, usage, and sharing practices, we advise you not to use our API.</p>
118
  <textarea id="example1" name="example1"># Example 1: Using OpenAI Python client
 
108
  <p>Here are some example codes to interact with the API:</p>
109
  <p><strong>Note:</strong> By using our API, you acknowledge and agree to the following terms regarding the data you provide:</p>
110
  <ul>
111
+ <li>Data Collection: This application may log the following data through the Gradio endpoint or the API endpoint: message requests (including messages, responses, model settings, and images sent along with the messages), images that were generated (including only the prompt and the image), search tool calls (including query, search results, summaries, and output responses), and moderation checks (including input and output).</li>
112
+ <li>Data Retention and Removal: Data is retained until further notice or until a specific request for removal is made.</li>
113
+ <li>Data Usage: The collected data may be used for various purposes, including but not limited to, administrative review of logs, AI training, and publication as a dataset.</li>
114
  <li>Privacy: Please avoid sharing any personal information.</li>
 
 
 
115
  </ul>
116
  <p>By continuing to use our API, you explicitly consent to the collection, use, and potential sharing of your data as described above. If you disagree with our data collection, usage, and sharing practices, we advise you not to use our API.</p>
117
  <textarea id="example1" name="example1"># Example 1: Using OpenAI Python client