un-index commited on
Commit
b83ba99
·
1 Parent(s): 9a78c86
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -66,7 +66,8 @@ def f(context, temperature, top_p, max_length, model_idx):
66
  #
67
  set_seed(randint(1, 2**31))
68
  # return sequences specifies how many to return
69
- return generator(context, max_length=max_length, top_p=top_p, temperature=temperature, num_return_sequences=1)
 
70
  # args found in the source: https://github.com/huggingface/transformers/blob/27b3031de2fb8195dec9bc2093e3e70bdb1c4bff/src/transformers/generation_tf_utils.py#L348-L376
71
 
72
  except Exception as e:
 
66
  #
67
  set_seed(randint(1, 2**31))
68
  # return sequences specifies how many to return
69
+ json = generator(context, max_length=max_length, top_p=top_p, temperature=temperature, num_return_sequences=1)
70
+ return json['generated_text']
71
  # args found in the source: https://github.com/huggingface/transformers/blob/27b3031de2fb8195dec9bc2093e3e70bdb1c4bff/src/transformers/generation_tf_utils.py#L348-L376
72
 
73
  except Exception as e: