Spaces:
Runtime error
Runtime error
Update app.py
Browse files8 unmodified lines910111213141516171819202122232425268 unmodified linesdef reply(message, history):m=message.replace('\n','')m=m.replace('\t','')inputs = tokenizer(f''' Review the Following text as a human, who is tasked to Extract `Code Snippets` ,if any. If there are no Code Snippets in the below Text then return No CODE HIDDEN:"{message}"''', return_tensors="pt")outputs = model.generate(**inputs)code=tokenizer.batch_decode(outputs, skip_special_tokens=True)return codedemo = gr.ChatInterface(reply)if __name__ == "__main__":demo.launch()8 unmodified lines91011121314151617188 unmodified linesdef slow_echo(message, history):for i in range(len(message)):time.sleep(0.3)yield "You typed: " + message[: i+1]gr.ChatInterface(slow_echo).queue().launch()
app.py+7-15