mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
add sample inputs functionality for texbox
This commit is contained in:
parent
68a1c6ae70
commit
32e6669c15
@ -173,6 +173,9 @@ class Webcam(AbstractInput):
|
||||
|
||||
|
||||
class Textbox(AbstractInput):
|
||||
def __init__(self, sample_inputs=None):
|
||||
self.sample_inputs = sample_inputs
|
||||
|
||||
def get_validation_inputs(self):
|
||||
return validation_data.ENGLISH_TEXTS
|
||||
|
||||
@ -196,6 +199,9 @@ class Textbox(AbstractInput):
|
||||
f.write(inp)
|
||||
return filename
|
||||
|
||||
def get_sample_inputs(self):
|
||||
return self.sample_inputs
|
||||
|
||||
|
||||
class ImageUpload(AbstractInput):
|
||||
def __init__(self, preprocessing_fn=None, shape=(224, 224, 3), image_mode='RGB',
|
||||
|
Loading…
Reference in New Issue
Block a user