innafomina commited on
Commit
98bcf14
·
verified ·
1 Parent(s): 932c307

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -27,16 +27,16 @@ def generate_jokes(joke_type:str)-> str: #it's import to specify the return type
27
  Args:
28
  joke_type: a string that specifies the type of joke to retrieve. Accepted arguments 'dad' or 'regular'
29
  """
30
- if joke_type == 'dad':
31
- path = 'gnumanth/dad-jokes'
32
- col = 'joke'
33
- else:
34
- path = 'Amirkid/jokes'
35
- col = 'text'
36
- dataset = load_dataset(path, split = "train")[col]
37
- # shuffle to make sure examples will be random
38
- dataset = dataset.shuffle()
39
- random_example = dataset[[col]][0]
40
 
41
  return random_example
42
 
 
27
  Args:
28
  joke_type: a string that specifies the type of joke to retrieve. Accepted arguments 'dad' or 'regular'
29
  """
30
+ if joke_type == 'dad':
31
+ path = 'gnumanth/dad-jokes'
32
+ col = 'joke'
33
+ else:
34
+ path = 'Amirkid/jokes'
35
+ col = 'text'
36
+ dataset = load_dataset(path, split = "train")[col]
37
+ # shuffle to make sure examples will be random
38
+ dataset = dataset.shuffle()
39
+ random_example = dataset[[col]][0]
40
 
41
  return random_example
42