alessandro trinca tornidor commited on
Commit
2ba4f98
·
1 Parent(s): 3444a36

[refactor] move custom formatter function to dedicated formatters.py module

Browse files
app_gradio_fastapi/helpers/formatters.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ def request_formatter(text: str) -> str:
2
+ return f"transformed {text}."
app_gradio_fastapi/main.py CHANGED
@@ -1,11 +1,8 @@
1
- from fastapi import FastAPI
2
  import gradio as gr
 
3
 
4
  from app_gradio_fastapi import routes
5
-
6
-
7
- def request_formatter(text: str) -> str:
8
- return f"transformed {text}."
9
 
10
 
11
  CUSTOM_GRADIO_PATH = "/"
 
 
1
  import gradio as gr
2
+ from fastapi import FastAPI
3
 
4
  from app_gradio_fastapi import routes
5
+ from app_gradio_fastapi.helpers.formatters import request_formatter
 
 
 
6
 
7
 
8
  CUSTOM_GRADIO_PATH = "/"