Skip to content

Commit

Permalink
added asyncio.run
Browse files Browse the repository at this point in the history
  • Loading branch information
ashimdahal committed Jun 19, 2022
1 parent e0c7d57 commit ea95a4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def talk(text,prev_convo):
pass
else:
unicoded_nepali = converter.convert(text)
text = translate_text(unicoded_nepali, source, target)
text = asyncio.run(translate_text(unicoded_nepali, source, target))

if prev_convo:
inp = get_input(text,previous_conversation=prev_convo)
else:
inp = get_input(text,)

out = query(inp)
generated_nepali = translate_text(out['generated_text'], 'en-US', 'ne')
generated_nepali = asyncio.run(translate_text(out['generated_text'], 'en-US', 'ne'))
out['generated_text'] = nr.romanize_text(generated_nepali).replace('0','o')
return out

Expand Down

0 comments on commit ea95a4c

Please sign in to comment.