mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-30 11:00:11 +08:00
fixed static checks
This commit is contained in:
parent
81e4a08a64
commit
946dffc87f
@ -2780,7 +2780,7 @@ class DatasetViewer(Component):
|
||||
|
||||
def get_template_context(self):
|
||||
return {
|
||||
"types": [_type.__class__.__name__.lower() for _type in types],
|
||||
"types": [_type.__class__.__name__.lower() for _type in self.types],
|
||||
"value": self.value,
|
||||
**super().get_template_context(),
|
||||
}
|
||||
|
@ -615,34 +615,6 @@ class Interface(Launchable):
|
||||
else:
|
||||
return predictions
|
||||
|
||||
def process_api(self, data: Dict[str, Any], username: str = None) -> Dict[str, Any]:
|
||||
flag_index = None
|
||||
if data.get("example_id") is not None:
|
||||
example_id = data["example_id"]
|
||||
if self.cache_examples:
|
||||
prediction = load_from_cache(self, example_id)
|
||||
durations = None
|
||||
else:
|
||||
prediction, durations = process_example(self, example_id)
|
||||
else:
|
||||
raw_input = data["data"]
|
||||
prediction, durations = self.process(raw_input)
|
||||
if self.allow_flagging == "auto":
|
||||
flag_index = self.flagging_callback.flag(
|
||||
self,
|
||||
raw_input,
|
||||
prediction,
|
||||
flag_option="" if self.flagging_options else None,
|
||||
username=username,
|
||||
)
|
||||
|
||||
return {
|
||||
"data": prediction,
|
||||
"durations": durations,
|
||||
"avg_durations": self.config.get("avg_durations"),
|
||||
"flag_index": flag_index,
|
||||
}
|
||||
|
||||
def process_api(self, data: Dict[str, Any], username: str = None) -> Dict[str, Any]:
|
||||
class RequestApi:
|
||||
SUBMIT = 0
|
||||
|
Loading…
Reference in New Issue
Block a user