spagestic commited on
Commit
c735b62
·
1 Parent(s): 0fc9213

feat: enhance Gradio interfaces for vector operations with detailed descriptions and examples

Browse files
maths/vectors/vector_add.py CHANGED
@@ -23,5 +23,7 @@ vector_add_interface = gr.Interface(
23
  ],
24
  outputs=gr.Textbox(label="Resulting Vector"),
25
  title="Vector Addition",
26
- description="Adds two vectors. Ensure they have the same dimensions."
 
 
27
  )
 
23
  ],
24
  outputs=gr.Textbox(label="Resulting Vector"),
25
  title="Vector Addition",
26
+ description="Adds two vectors of the same dimension.\n\nExample:\nInput: [1,2,3] and [4,5,6]\nOutput: [5.0, 7.0, 9.0]",
27
+ examples=[(["[1,2,3]", "[4,5,6]"], "[5.0, 7.0, 9.0]"),
28
+ (["1,2,3", "4,5,6"], "[5.0, 7.0, 9.0]")],
29
  )
maths/vectors/vector_cross_product.py CHANGED
@@ -24,5 +24,7 @@ vector_cross_product_interface = gr.Interface(
24
  ],
25
  outputs=gr.Textbox(label="Resulting Vector (3D)"),
26
  title="Vector Cross Product",
27
- description="Calculates the cross product of two 3D vectors."
 
 
28
  )
 
24
  ],
25
  outputs=gr.Textbox(label="Resulting Vector (3D)"),
26
  title="Vector Cross Product",
27
+ description="Calculates the cross product of two 3D vectors.\n\nExample:\nInput: [1,2,3] and [4,5,6]\nOutput: [-3.0, 6.0, -3.0]",
28
+ examples=[(["[1,2,3]", "[4,5,6]"], "[-3.0, 6.0, -3.0]"),
29
+ (["1,2,3", "4,5,6"], "[-3.0, 6.0, -3.0]")],
30
  )
maths/vectors/vector_dot_product.py CHANGED
@@ -24,5 +24,7 @@ vector_dot_product_interface = gr.Interface(
24
  ],
25
  outputs=gr.Textbox(label="Dot Product (Scalar)"),
26
  title="Vector Dot Product",
27
- description="Calculates the dot product of two vectors. Ensure they have the same dimensions."
 
 
28
  )
 
24
  ],
25
  outputs=gr.Textbox(label="Dot Product (Scalar)"),
26
  title="Vector Dot Product",
27
+ description="Calculates the dot product of two vectors of the same dimension.\n\nExample:\nInput: [1,2,3] and [4,5,6]\nOutput: 32.0",
28
+ examples=[(["[1,2,3]", "[4,5,6]"], "32.0"),
29
+ (["1,2,3", "4,5,6"], "32.0")],
30
  )
maths/vectors/vector_subtract.py CHANGED
@@ -24,5 +24,7 @@ vector_subtract_interface = gr.Interface(
24
  ],
25
  outputs=gr.Textbox(label="Resulting Vector"),
26
  title="Vector Subtraction",
27
- description="Subtracts the second vector from the first. Ensure they have the same dimensions."
 
 
28
  )
 
24
  ],
25
  outputs=gr.Textbox(label="Resulting Vector"),
26
  title="Vector Subtraction",
27
+ description="Subtracts the second vector from the first. Both must have the same dimension.\n\nExample:\nInput: [4,5,6] and [1,2,3]\nOutput: [3.0, 3.0, 3.0]",
28
+ examples=[(["[4,5,6]", "[1,2,3]"], "[3.0, 3.0, 3.0]"),
29
+ (["4,5,6", "1,2,3"], "[3.0, 3.0, 3.0]")],
30
  )