jhj0517 commited on
Commit
b3ffc71
·
1 Parent(s): a2bf507

update docstring

Browse files
Files changed (1) hide show
  1. modules/whisper_data_class.py +12 -6
modules/whisper_data_class.py CHANGED
@@ -13,9 +13,9 @@ class WhisperGradioComponents:
13
  compute_type: gr.Dropdown
14
  """
15
  A data class to pass Gradio components to the function before Gradio pre-processing.
16
- See this documentation for more info: https://www.gradio.app/docs/components
17
 
18
- Parameters
19
  ----------
20
  model_size: gr.Dropdown
21
  Whisper model size.
@@ -39,7 +39,7 @@ class WhisperGradioComponents:
39
 
40
  def to_list(self) -> list:
41
  """
42
- Use this to pass parameters before Gradio pre-processing to the function.
43
 
44
  Returns
45
  ----------
@@ -50,7 +50,13 @@ class WhisperGradioComponents:
50
  @staticmethod
51
  def to_values(*params):
52
  """
53
- Use this to use parameters after Gradio pre-processing in the function.
 
 
 
 
 
 
54
 
55
  Returns
56
  ----------
@@ -69,6 +75,6 @@ class WhisperValues:
69
  no_speech_threshold: float
70
  compute_type: str
71
  """
72
- A data class to use Whisper parameters in the function after gradio pre-processing.
73
- See this documentation for more info : https://www.gradio.app/docs/components
74
  """
 
13
  compute_type: gr.Dropdown
14
  """
15
  A data class to pass Gradio components to the function before Gradio pre-processing.
16
+ See this documentation for more information about Gradio pre-processing: https://www.gradio.app/docs/components
17
 
18
+ Attributes
19
  ----------
20
  model_size: gr.Dropdown
21
  Whisper model size.
 
39
 
40
  def to_list(self) -> list:
41
  """
42
+ Converts the data class attributes into a list, to pass parameters to a function before Gradio pre-processing.
43
 
44
  Returns
45
  ----------
 
50
  @staticmethod
51
  def to_values(*params):
52
  """
53
+ Convert a tuple of parameters into a WhisperValues data class, to use parameters in a function after Gradio pre-processing.
54
+
55
+ Parameters
56
+ ----------
57
+ *params: tuple
58
+ This is provided in a tuple because the parameters are passed to a function as a list, for example
59
+ btn.click(fn=function, inputs=[comp1, comp2], outputs=[comp3])
60
 
61
  Returns
62
  ----------
 
75
  no_speech_threshold: float
76
  compute_type: str
77
  """
78
+ A data class to use Whisper parameters in the function after Gradio pre-processing.
79
+ See this documentation for more information about Gradio pre-processing: : https://www.gradio.app/docs/components
80
  """