mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-24 13:01:18 +08:00
Accept deprecated file
route as well (#2099)
* fix * added docs * fixes
This commit is contained in:
parent
6219dc7b0c
commit
4f0b8f9829
gradio
guides
@ -236,6 +236,10 @@ class App(FastAPI):
|
||||
f"it is not in any of {app.blocks.temp_dirs}"
|
||||
)
|
||||
|
||||
@app.get("/file/{path:path}", dependencies=[Depends(login_check)])
|
||||
def file_deprecated(path: str):
|
||||
return file(path)
|
||||
|
||||
async def run_predict(
|
||||
body: PredictBody, username: str = Depends(get_current_user)
|
||||
):
|
||||
|
@ -25,7 +25,17 @@ $code_gender_sentence_custom_interpretation
|
||||
|
||||
## Custom Styling
|
||||
|
||||
If you'd like to have more fine-grained control over any aspect of your demo, you can also write your own css or pass in a css file, with the `css` parameter of the `Interface` class.
|
||||
If you'd like to have more fine-grained control over any aspect of your demo, you can also write your own css or pass in a filepath to a css file, with the `css` parameter of the `Interface` class.
|
||||
|
||||
```python
|
||||
gr.Interface(..., css="body {background-color: red}")
|
||||
```
|
||||
|
||||
If you'd like to reference external files in your css, preface the file path (which can be a relative or absolute path) with `"file="`, for example:
|
||||
|
||||
```python
|
||||
gr.Interface(..., css="body {background-image: url('file=clouds.jpg')}")
|
||||
```
|
||||
|
||||
## Loading Hugging Face Models and Spaces
|
||||
|
||||
|
@ -9,7 +9,14 @@ with gr.Blocks(css="body {background-color: red}") as demo:
|
||||
...
|
||||
```
|
||||
|
||||
You can also pass the filepath to a CSS file to this argument.
|
||||
If you'd like to reference external files in your css, preface the file path (which can be a relative or absolute path) with `"file="`, for example:
|
||||
|
||||
```python
|
||||
with gr.Blocks(css="body {background-image: url('file=clouds.jpg')}") as demo:
|
||||
...
|
||||
```
|
||||
|
||||
You can also pass the filepath to a CSS file to the `css` argument.
|
||||
|
||||
## The `elem_id` Argument
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user